how long do restored versions take to go live?
how long do restored versions take to go live?
how long do restored versions take to go live?
The featured image is saved as postmeta, and by default, postmeta is not stored in revisions. This means that if anyone removes the featured image and saves (updates) their post, that postmeta is removed and not associated to the post anywhere. If you need to modify this behavior for the future, you can programmatically enable … Read more
Displaying a List of Changes / Updates on the Website Publicly
There are a few methods to disable autosave/revisions. Disabling autosave: Using action and dequeuing the .js that is responsible for autosave, this goes into functions.php, located in the current theme directory. function bt_disable_autosave () { wp_deregister_script(‘autosave’); } add_action(‘admin_init’, ‘bt_disable_autosave’); Using a constant to set the interval so high (one day) it will never happen unless … Read more
Have you tried adding an extra clause checking for the revision post type in function pts_save_post( $post_id, $post ) { of post-type-switcher.php ? E.g. as taken from trunk and modified: /** * Set the post type on save_post but only when editing * * @since PostTypeSwitcher (0.3) * @global string $pagenow * @param int $post_id … Read more
You can use define (‘WP_POST_REVISIONS’, 2); in wp-config.php for two revisions, and you could turn that into your own plugin. Manully remove all revisions with this query run in phpmyadmin: DELETE a,b,c FROM wp_posts a LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id) LEFT JOIN wp_postmeta c ON (a.ID = c.post_id) WHERE a.post_type=”revision” and then … Read more
How do I manage custom meta in post revisions in the Block Editor era?
It’s not a good idea to run old versions of WordPress. Fortunately, you can quite easily turn off post revisions by using the wp_revisions_to_keep filter. Add the following code snippet to a plugin, or to your active theme’s functions.php file: add_filter( ‘wp_revisions_to_keep’, ‘wpse_368635_disable_revisions’ ); function wpse_368635_disable_revisions( $revisions ) { // Setting the value to 0 … Read more
If you need an SQL query, then this option should be suitable function src_flush_revisions () { global $wpdb; $post_id = 5//exp post id if ( isset( $timeLimit ) ) { $revision_ids = $wpdb->get_col( $wpdb->prepare( “SELECT `ID` FROM $wpdb->posts WHERE `post_type` = ‘revision’ AND `post_parent` = %d”, $post_id ) ); foreach ( $revision_ids as $revision_id ) … Read more
From just looking at your snippet you’re not actually setting $post_revisions to any value before assigning it to your $post_data array