Developing Themes with React/Angular

First of all like Fayaz had said questions with multiple questions are not the best way to ask something on this platform. Ok, let me try to answer your questions. (Disclaimer: I’m not an react expert. So please don`t hang me if i tell something stupid.) Question 1: No you need not Node.js but npm … Read more

Add Products to user’s ID Woocommerce

/* Add to cart product api */ add_action( ‘rest_api_init’, function () { register_rest_route( ‘wp/v2’, ‘add_to_cart_product’, array( ‘methods’ => array(‘GET’,’POST’), ‘callback’ => ‘add_to_cart_product’, ) ); } ); function add_to_cart_product(){ //wp_set_current_user($_POST[‘user_id’]); /*wp_set_auth_cookie($_POST[‘user_id’]);*/ /* Required Parameters $_POST[‘user_id’] $_POST[‘product_id’] */ global $woocommerce,$wpdb; $array = $wpdb->get_results(“select meta_value from “.$wpdb->prefix.”usermeta where meta_key=’_woocommerce_persistent_cart_1′ and user_id = “.$_POST[‘user_id’]); $data =$array[0]->meta_value; $cart_data=unserialize($data); $flag = … Read more

WordPress: How to create custom REST API route?

We can create route using rest_api_init action like : Simply add below code to your theme functions.php file. add_action( ‘rest_api_init’, function () { register_rest_route(‘wp/v2’, ‘forgot_password’, array( ‘methods’ => array(‘GET’, ‘POST’), ‘callback’ => ‘forgot_password’ )); } ); function forgot_password(){ // YOUR CALLBACK FUNCTION STUFF HERE } forgot_password will define route URL address. methods will define which … Read more

Can’t send emails through REST API

You didn’t include the code for your send_email() function, but I looked at the original source (revision 1) of your question, and it seems to me that your send_email() function is good, but if this answer doesn’t help solve the issue, then add the function code into your question body. So I don’t know why … Read more

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