Updata Metadata WP Rest API

Two things need to be changed 1 – wishlistPost.metadata.wishlist_array which is the metadata returns an object with a string inside, not an array. var wishlist_array = wishlistPost.metadata.wishlist_array[0]; //Get current string wishlist_array += postID + “,”; //Concat new ID to the current string 2 – JSON.stringify(wishlist_array) is not needed as stated above wishlist_array is a string … Read more

Error in WP_update_post

The key to using WordPress outside of WordPress is include the wp-load.php file: So your code will like: <?php // Include the wp-load’ include(‘YOUR_WP_PATH/wp-load.php’); // Update post 1 hello word $my_post = array( ‘ID’ => 1, ‘post_title’ => ‘This is the updated post title.’, ‘post_content’ => ‘This is the updated content.’, ); // Update the … Read more

Multiple entries in get_option results? or why is _multiwidget set to 1?

I found the answer. Multiwidget is a nice new feature within wordpress’ new widget API. Yet there is sparse documentation on how to use it. $options = get_option( ‘your_option_id’ ); if( isset($options) && isset($options[$this->number])) { //$this->number returns the unique widget id that corresponds to the database index $instance_options = $options[$this->number]; } //now use $instance_options[‘setting’]

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