Today I discovered that on every site where we use WooCommerce + Toolset (Types, Views or Blocks, and WooCommerce Views or WooCommerce Blocks) there was a bug where new Posts were being created _and published_ with the title Auto Draft. None of the sites in question have CRED / Toolset Forms installed.
The issue occurs every time the user goes to the main Dashboard screen. The post is assigned to the admin user who visits the Dashboard. The solution appears to be to disable via a function the 'Quick Draft' module on the Dashboard screen, using this snippet:
/*
Disable Some Default Dashboard Widgets
@ <em><u>hidden link</u></em>
*/
function disable_default_dashboard_widgets() {
global $wp_meta_boxes;
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);
}
add_action('wp_dashboard_setup', 'disable_default_dashboard_widgets', 999);
Around 45 of our websites were affected. They all had up to date plugins, including Toolset and Woo, and the latest WP core. I have included debug information for one of the affected sites.
I can't be sure that it's a Toolset-specific issue, but on the handful of websites we host which have WooCommerce but NOT Toolset, I was unable to observe the problem happening. I am flagging this here as something you may wish to investigate, although I recognise it's possibly a core WP bug or WooCommerce bug, or some obscure interaction between all these elements.
Hello,
Thanks for sharing the workaround, as you mentioned above:
but on the handful of websites we host which have WooCommerce but NOT Toolset ... it's possibly a core WP bug or WooCommerce bug
It seems not a Toolset issue, I have searched it in Google, and found other same issues as you mentioned above, for example:
hidden link
Which is not related with Toolset too, might be a WP core bug.
I found that post too (although it's six years old and it's not the same issue, exactly, as she describes drafts that can't be deleted - my issue is posts that can be deleted but are actually published and appearing on the front-end of the site!)
As I say, it's not affecting my non-Toolset sites, hence the ticket, but if you can't reproduce it then fair enough
can you upgrade the Woocommerce plugin of your website to the latest version and test again?
See their development logs:
https://wordpress.org/plugins/woocommerce/#developers
Fix – Removing auto-draft as wc post type to resolve publish time bug
And I have tried it in a fresh WP installation, it works fine, see below sandbox website:
Login URL: hidden link
Good to know it was a Woo issue - although I only saw the problem 'in the wild' on sites which also had Toolset. Thanks for your help.