How to list the authors of all revisions?

Use Can Use Below This Function For Get All Revisions in Author Details With checked Duplicate . According to your need. function get_all_revisions($post_id){ //get all revisions of particular Page Id & Post Id $revision = wp_get_post_revisions($post_id); $post_author_id = array(); foreach ($revision as $key => $value) { // Check Id Already Exists in Array if ( … Read more

Disable revision access for a specific user role

I resolved this in the end by removing access to the revisions meta box for certain user types… if (get_current_user_role()==”custom_user_role”){ function my_remove_revisions() { remove_meta_box(‘revisionsdiv’, ‘apartments’, ‘normal’); } add_action( ‘admin_menu’, ‘my_remove_revisions’ ); }

Get last revision author, author-link and date

To get the_modified_author() we have to look in the folder wp-includes and search for the author-template.php. Line 101 shows: /** * Display the name of the author who last edited the current post, * if the author’s ID is available. * * @since 2.8.0 * * @see get_the_author() */ function the_modified_author() { echo get_the_modified_author(); } … Read more

Post revisions disappeared (for some posts)

Check your database to see if the revisions are still there. Use phpmyadmin or another database tool and go to wp_posts table and search for post_type = revision. If they are not there, they are gone. A lot of “optimization” plugins remove post revisions for you. I would check if any of your plugins has … Read more

Define a wordpress constant through plugin functions?

I don’t think you should define constants in your plugin. It will be very hard to debug later on. IMHO using wp_revisions_to_keep filter will be much nicer solution. So your code could look like this: add_filter( ‘wp_revisions_to_keep’, ‘my_revisions_to_keep_based_on_settings’, 10, 2 ); function my_revisions_to_keep_based_on_settings( $num, $post ) { // change that according to your needs return … Read more

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