wp_delete_auto_drafts() deletes links in menus

Since yesterday the wp_scheduled_auto_draft_delete cron job somehow deletes all page entries from our menus. All entries in the table wp_postmeta with meta_key = ‘_menu_item_object’ and meta_value=”page” get deleted in the process. By tracing back the DELETE query I found out that the menu entries are deleted by a function called _wp_delete_post_menu_item. I got the following … Read more

Post Auto Draft Issue

I’ve made custom post type without title and editor and I use custom taxonomies, custom fields and attachments to form a post. My title is generated from custom taxonomies and custom fields (or “ID #” if nothing else is set). Here’s title code (could use some polishing probably): function custom_post_type_title ( $post_id ) { global … Read more

Create slugs programmatically

I’m updating programmatically posts in a WP 3.01 install, using custom made tools. Sometimes I do change programmatically post_status from DRAFT to PUBLISHED using custom SELECT queries, however this seems spoiling posts permalinks. When in a DRAFT state, posts have the following link structure http://myblog.com/?p=73006 Could there be some “trick” to force a change in … Read more

How to disable drafts?

Using WordPress 3.1 is it possible to completely disable the drafts functionality or at least remove the “Save Draft” button from the post screen? 2 Answers 2 If by draft, you mean “autosave”, you can consider using this plugin: http://wordpress.org/extend/plugins/wp-feature-disable/ If you want to disable revisions, instead…try this: define(‘WP_POST_REVISIONS’, ‘false’); You can put that in … Read more

How to make draft posts or posts in review accessible via full url / slug?

I am running a website with WordPress 4.2 and have changed the way draft posts or posts in review status are displayed to non logged in users (these posts are, too, visible to anyone who visits the website). I have implemented this solution presented here: https://wordpress.org/support/topic/problem-filtering-query-to-allow-displaying-drafts-even-for-not-logged-users Now, while anyone can now access draft posts / … Read more