How to use wp_update_post with ajax on frontend

hmmm…. I don’t see a problem with your code. When I run into 500, it’s usually due to permissions or htaccess mis-routing the request. That said, some things to try: 1) in wp-config.php, set debug WP_DEBUG to true. This may offer a more descriptive error message. 2) WordPress has good integration for AJAX. You can … Read more

Custom wp_editor doesn’t update post_content

After some searching and working off of some pointers from toscho, and some other helpful posts to avoid an infinite loop I managed to figure out a solution. I’ll post the code below then briefly explain: // Hook into the actions here public function __construct() { add_action( ‘add_meta_boxes’, array($this, ‘meta_boxes’ )); add_action( ‘save_post’, array($this, ‘save_bio_data’ … Read more

wp_update_post making my post sticky

I need to add: post_date_gmt $post_information = array( ‘ID’ => $_REQUEST[‘ID’], ‘post_content’ => $_REQUEST[‘content’], ‘post_status’ => ‘publish’, ‘post_date_gmt’ => $post->post_date_gmt ); wp_update_post($post_information);

SQL / wp_update_post: change post custom field to CPT post taxonomy

You’ve got the right idea but you are using some of the functions and function arguments incorrectly. // get all post IDs $post_ids = get_posts( array( ‘post_type’ => ‘post’, ‘post_status’ => ‘publish’, ‘numberposts’ => -1, // get all posts. ‘fields’ => ‘ids’, // Only get post IDs ) ); // info: custom field ‘actor’ = … Read more