Is it possible to display previous post revision?

First we look into the wp_get_post_autosave function It’s informative to see how the core function wp_get_post_autosave() uses the wp_get_post_revisions() function. It loops over all revisions from $revisions = wp_get_post_revisions( $post_id, array( ‘check_enabled’ => false ) ); and then uses: foreach ( $revisions as $revision ) { if ( false !== strpos( $revision->post_name, “{$post_id}-autosave” ) ) … Read more

Enabled Revisions to existing custom post type not working WordPress

$cap_type=”post”; $plural=”Products”; $single=”Product”; $cpt_name=”products”; $opts[‘supports’] = array( ‘products’, ‘title’, ‘editor’, ‘thumbnail’, ‘author’, ‘revisions’ ); $opts[‘can_export’] = TRUE; $opts[‘capability_type’] = $cap_type; $opts[‘description’] = ”; $opts[‘exclude_from_search’] = FALSE; $opts[‘has_archive’] = TRUE; $opts[‘hierarchical’] = TRUE; $opts[‘map_meta_cap’] = TRUE; $opts[‘menu_icon’] = ‘dashicons-products’; $opts[‘menu_position’] = 2; $opts[‘public’] = TRUE; $opts[‘publicly_queryable’] = TRUE; $opts[‘query_var’] = TRUE; $opts[‘register_meta_box_cb’] = ”; $opts[‘rewrite’] = … Read more

How can we publish revisions of a post, in addition to showing the latest post?

I suggest you look at https://codex.wordpress.org/Function_Reference/wp_get_post_revisions <?php // Lets get the revisions of the given $post we are accessing by ID ( you are probably going to want to limit your internal revision count for this $revisions = wp_get_post_revisions($post->ID); // lets just do some formatting here ( your post html content is going to display … Read more

Disable revisions for a specific post type only?

Remove the revisions property inside the supports parameter of register_post_type(). Example $args = array( // … ‘supports’ => array(‘title’,’editor’,’thumbnail’,’comments’,’revisions’) ); register_post_type(‘book’,$args); Change to: $args = array( // … ‘supports’ => array(‘title’,’editor’,’thumbnail’,’comments’) ); register_post_type(‘book’,$args);

how to enable different number of revisions for different blogs when using WPMU?

No, wp-config.php can have granular constants. Like this: if ( ‘example.com’ == $_SERVER[‘HTTP_HOST’] ) { define( ‘WP_POST_REVISIONS’, 1 ); } elseif ( ‘blog1.example.com’ == $_SERVER[‘HTTP_HOST’] ) { define( ‘WP_POST_REVISIONS’, 5 ); } elseif ( ‘blog2.example.com’ == $_SERVER[‘HTTP_HOST’] ) { define( ‘WP_POST_REVISIONS’, 10 ); }

Define maximum number of revisions per post type?

I might be wrong, but my first guess would be that this is not easily possible, because number of revisions gets saved into constant and does not seem hook-able. From quick search relevant checks are in wp_save_post_revision() and it’s very rigid.

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