wp_delete_auto_drafts() deletes links in menus

This is what normal query run by wp_get_associated_nav_menu_items() looks like: SELECT wp_posts.* FROM wp_posts INNER JOIN wp_postmeta ON ( wp_posts.id = wp_postmeta.post_id ) WHERE 1 = 1 AND wp_posts.post_type=”nav_menu_item” AND (( wp_posts.post_status <> ‘trash’ AND wp_posts.post_status <> ‘auto-draft’ )) AND (( wp_postmeta.meta_key = ‘_menu_item_object_id’ AND Cast(wp_postmeta.meta_value AS CHAR) = ‘3111’ )) GROUP BY wp_posts.id ORDER … Read more

How to disable drafts?

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 your /wp-config.php file and it should immediately take effect. Any previously saved revisions in your database will need to be purged. You can do it by running … Read more

Custom CSS for viewing a draft page on the frontend?

There is probably a better way but you could add the following CSS to your stylesheet, which will add a little banner when viewing a page that has a status of draft. .status-draft.hentry:before { content: “Previewing a Draft”; background: #87C5D6 !important; display: block; text-align: center; } You could also use these classes for the different … Read more

How to show the real post date in a draft

Yes, as you – so far – have no publish date. You could use $post->post_modified, which will always be the date of the latest modification to the post data. Debug: Try hooking into the filter and dump both vars: function date_dump_callback( $date, $d ) { echo ‘<pre>’; print_r( $date ); print_r( $d ); echo ‘</pre>’; … Read more

I can’t preview post’s change once they are published

This is probably not the best way to do it since it wont persist after wordpress updates (but hopefully the update will correct it. In wp-admin/includes/post.php ,edit the post_preview() function just before returning the apply_filters( ‘preview_post_link’, $url ); put the following code: //ORIGINAL //$url = add_query_arg( $query_args, get_permalink( $post->ID, true ) ); //CHANGES to make … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)