WP_Query filters

Assuming you want to keep the WP_Query exactly the same there’s 2 ways I can think of which you could do this using various loops. 1) Grab the first post from the posts Array. WP_Query has a bunch of properties and methods one of which is the posts array. if( $the_query->have_posts() ) { // Grab … Read more

How to modify WCMP Rest API response?

Finally I had solved it! In the source code of the plugin “dc-woocommerce-multi-vendor”, I had viewed the class “class-wcmp-rest-vendors-controller.php” and figured out that they are using this filter in order to gather up the fields of the response: apply_filters(“wcmp_rest_prepare_vendor_object_args”, array(…)); In the functions.php of the child theme I had written this code to edit the … Read more