Updating a custom post status after an expiry date rather than trashing it
Updating a custom post status after an expiry date rather than trashing it
Updating a custom post status after an expiry date rather than trashing it
Revert a Draft page to its original version
If you have access to phpMyAdmin you can run this SQL query directly: UPDATE {prefix}posts SET post_status=”draft” WHERE post_status=”publish” If you do not have any experience with SQL queries then you should use this solution. Just place this code in functions.php and refresh the WordPress once, and it will be done. function setPostsToDraft() { global … Read more
I’m posting this as another solution for you and its based on the page id /* $post_id – The ID of the post you’d like to change. $status – The post status publish|pending|draft|private|static|object|attachment|inherit|future|trash. */ function change_post_status($post_id,$status){ $current_post = get_post( $post_id, ‘ARRAY_A’ ); $current_post[‘post_status’] = $status; return wp_update_post($current_post); } So once you have this function you … Read more
a similar question was asked before, if you take a look here obviously for 1 column use ‘post_status’ => ‘published’ and for the other column call ‘post_status’ => ‘draft’ and set number of posts to show to 8 for each column
try pasting this in your theme’s functions.php file add_filter( ‘parse_query’, ‘display_autosave_and_revisions’ ); function display_autosave_and_revisions( $query ) { global $pagenow,$typenow; if ( is_admin() && $pagenow == ‘edit.php’ && $typenow == “post”) { $query->query_vars[‘post_type’] = array(‘revision’,’post’); $query->query_vars[‘post_status’] = ‘any’; } }
I found Quick Review Post Access (Figure 1) which does the trick. It’s not perfect; I was hoping for the little circle, but this works just as well, and even better, it links directly to the page with non-drafts filtered out, making it even easier to keep track of and work with incomplete posts. It … Read more
WordPress has built in Revision Management. You can set the saved revisions to a custom number in the wp-config.php file in your installation. define( ‘WP_POST_REVISIONS’, 30 ); NOTE: You should be aware of the »autosave« mechanism, which also sets post revisions. So leaving a tab open for 1 hour with a Post Revision interval of … Read more
Use the pre_get_posts action to alter the main query with meta_query arguments to only select posts with active current_status. This example would work for your main posts page. See Conditional Tags for how to determine when other types of queries are run. function wpa_current_status( $query ) { if ( $query->is_home() && $query->is_main_query() ) { $meta_query … Read more
In some cases, the permalink structure must be updated in order for the new template files to be accessed when viewing posts of a custom post type. To do this, go to Administration Panels > Settings > Permalinks, change the permalink structure to a different structure, save the changes, and change it back to the … Read more