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

How to receive data by http POST request

Ok, here’s my answer for what it’s worth. I use this plugin: https://github.com/dphiffer/wp-json-api HOWEVER! This plugin was removed from the official plugin site for unknown reasons. But, I use it for a custom API so I don’t upload the built-in controllers and deactivate the core controller. The way it works: Write your own custom controller … Read more

wp_get_post_terms is difference obj model than the one in rest api response

I got fixed my problem by using the method prepare_item_for_response in WP_REST_Terms_Controller function custome_posts_response(WP_REST_Response $data, WP_POST $post, WP_REST_Request $request) { $newspapers = wp_get_post_terms($post->ID, ‘newspaper’); $categories = wp_get_post_terms($post->ID, ‘category’); $tags = wp_get_post_terms($post->ID, ‘post_tag’); $newspaper_ctrl = new WP_REST_Terms_Controller(‘newspaper’); $category_ctrl = new WP_REST_Terms_Controller(‘category’); $tags_ctrl = new WP_REST_Terms_Controller(‘post_tag’); $newspapers = array_map(function( WP_TERM $newspaper ) use ($newspaper_ctrl, $request) { return … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)