Enabling autosave when plugin disabled

I found that Woocommerce is disabling autosave, maybe for good reason, but I’d like to have it turned on and see if it presents an issue. This is what I found in the __construct in their post type class, from wp-content/plugins/woocommerce/includes/admin/class-wc-admin-post-types.php…. // Disable Auto Save add_action( ‘admin_print_scripts’, array( $this, ‘disable_autosave’ ) ); Then further down … Read more

Support auto-save and revisions for custom fields

I recently read this tutorial about custom fields in WordPress and wrote a simple plug-in to provide a metabox with a set of input fields. I do not use the Meta Box plug-in promoted on the web site. My implementation for the save_post hook is as follows: function save_my_data( $post_id ) { if ( defined( … Read more

Why wp_is_post_autosave doesn’t return anything?

After saving a post I check the console and $is_autosave is simply not set function save_func($post_id){ $is_autosave = wp_is_post_autosave( $post_id ); file_put_contents(‘php://stderr’, print_r(“Autosave: “.$is_autosave, TRUE)); } add_action(‘save_post’,’save_func’); Output: Autosave: Technically since it’s not an autosave the result should be: Output: Autosave: 0 0

CPU usage: AJAX and Heartbeat API on admin pages

My (shared) web host recently sent me this: “Our server monitoring systems keep indicating high server load persistently maintained by your website (…). Most of the hits are to the /www/www/wp-admin/admin-ajax.php script. We would advise the following: Do not stay logged into the WordPress dashboard through the day. Once you finish your work, you should … Read more