Limit REST API output to current logged in user that is also author of the content

https://developer.wordpress.org/rest-api/using-the-rest-api/frequently-asked-questions/#require-authentication-for-all-requests This requires authentication for all reque​sts. add_filter( ‘rest_authentication_errors’, function( $result ) { if ( ! empty( $result ) ) { return $result; } if ( ! is_user_logged_in() ) { return new WP_Error( ‘rest_not_logged_in’, ‘You are not currently logged in.’, array( ‘status’ => 401 ) ); } return $result; }); Now when I add a … Read more

How to filter Post using Meta Data REST API

I want to list post that filtered by Meta Data I have tried many solutions i found here but i can’t make it work. The last solution i tried is to add this to my functions.php add_filter( ‘rest_product_query’, function( $args, $request ){ if ( $stocks = $request->get_param( ‘stocks’ ) ) { $args[‘meta_key’] = ‘stocks’; $args[‘meta_value’] … Read more

using woocommerce_template_single_add_to_cart in shop-loop – javascript issues [closed]

Closed. This question is off-topic. It is not currently accepting answers. Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third party plugins and themes are off topic, they are better asked about at their developers’ support routes. Closed 1 … Read more