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 save post with different languages and linked them with WPML?

Thank @Sally CJ I made the solution : main code global $sitepress_settings; //Insert post with main lang $post = $binding_main_cpt[‘post’]; $default_language = $sitepress_settings[‘default_language’]; $main_post = $post[$default_language]; $postInformation = [ ‘post_title’ => wp_strip_all_tags(trim($main_post[‘post_title’] ) ), ‘post_content’ => $main_post[‘post_content’], ‘post_type’ => $main_post_type, ‘post_status’ => ‘publish’ ]; $master_post_id = wp_insert_post($postInformation); echo sprintf( “insert post %d”, $master_post_id ); foreach($sitepress_settings[‘active_languages’] … Read more

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