How to edit posts/pages without making the change live?
How to edit posts/pages without making the change live?
How to edit posts/pages without making the change live?
Well in your for loop, I think you’re missing the $postcount variable… also there’s a typo at $idss[$i] …. should be $ids[i] based on what you’ve shown. for ($i = 0; $i < $postcount; $i++) { wp_update_post(array(‘ID’ => $ids[$i], ‘post_status’ => ‘draft’)); } That being said I’d just go with a foreach loop. The mistake … Read more
So I’ve done it and explained in a blog post: http://eliasgomez.pro/articulos/merge-posts-he-hecho-plugin-fusionar-entradas-wordpress/
The problem is that you’re only hooking the cron action on admin_init, which doesn’t run when wp-cron.php is called. So the function will never run. So this function shouldn’t be inside wpcp_activate(): add_action( ‘wpcp_cron_hook’, ‘wpcp_cron_do’ ); Also, register_activation_hook() shouldn’t be inside the admin_init hook either. So your code should look like this: function wpcp_make_post( $post_title, … Read more
Add custom action to the page listing screen
Can you try the following in your wp-config.php define( ‘AUTOSAVE_INTERVAL’, 3600 ); // autosave 1x per hour define( ‘WP_POST_REVISIONS’, false ); // no revisions What this would do disable auto-save and post-revisions. Try with that, if it works could be your then it could be your internet or hosting conflicts.
Yes, these are probably the right calls to use for what you want. I just checked this by adding this to my functions.php: add_action(‘publish_to_draft’, ‘doStuff’); function doStuff() { update_option(‘foo’, ‘bar1’); } Then using the quick edit in the posts list to change a published post to draft, and this hook definitely ran at that point … Read more
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