Fatal error: Call to undefined function wp_cache_get after update attempt

I think W3 Total Cache or any Cache related plugin is still activate in your site. Try to de-active all plugins manually. Using Database Open Phpmyadmin Database of the website. In the table wp_options, under the option_name column (field) find the active_plugins row. Change the option_value field to: a:0:{} Using FTP or SSH In case … Read more

wp_update_post behaves differently for different user role

I solved this problem by creating a new user type with unfiltered_html set to true $result = add_role( ‘jobseeker’, __( ‘Job Seeker’ ), array( ‘read’ => true, ‘edit_posts’ => true, ‘delete_posts’ => true, ‘delete_published_posts’ => true, ‘upload_files’ => true, ‘edit_others_posts’ => false, ‘delete_others_posts’ => false, ‘unfiltered_html’ => true, //this line does the magic ) ); … Read more

Update button (sometimes) greyed-out

Update button is not always active. If the WordPress is auto-saving current post content, the update button will be disabled. This is normally done once every 60 seconds (default autosave interval). Auto-saving is done using AJAX, and if your website is slow to respond, autosave process can take a lot of time to finish. Depending … Read more

wp_update_post ignores if/else

How is this possible? I can think of one possibility that for some reason ur page is getting auto reloaded. So the flow of execution is like: you access the page, your code gets executed changing status from draft to published, then some other code gets executed and the page is reloaded. This time when … Read more

Is it possible to “Update” pages via SQL?

wp_update_post() is a PHP function, and you can’t trigger a page update with MySQL. You need to at least use PHP, but it’s possible that some plugins actually require manually pressing update. For WordPress and WooCommerce content your best bet would be to use the REST API or WP CLI from the command line.