From 0db2c5af385f7fcb50e4f7f03e5ec77fba883bba Mon Sep 17 00:00:00 2001 From: Matt Perry Date: Wed, 22 Jan 2014 20:30:45 -0800 Subject: [PATCH] Fix isues with CSS revisions meta box - eliminates notice produced by mis-use of wp_revisions_to_keep - makes "Show more" link disappear when the max number of revisions is shown related to #108 --- modules/custom-css/custom-css.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/custom-css/custom-css.php b/modules/custom-css/custom-css.php index e3b6e45642104..bd10b508b6923 100644 --- a/modules/custom-css/custom-css.php +++ b/modules/custom-css/custom-css.php @@ -887,12 +887,12 @@ static function publish_box() { * @return string */ static function revisions_meta_box( $safecss_post ) { - if ( function_exists( 'wp_revisions_to_keep' ) ) - $max_revisions = wp_revisions_to_keep( $safecss_post ); - else - $max_revisions = defined( 'WP_POST_REVISIONS' ) && is_numeric( WP_POST_REVISIONS ) ? (int) WP_POST_REVISIONS : 25; - $posts_per_page = isset( $_GET['show_all_rev'] ) ? $max_revisions : 6; + $show_all_revisions = isset( $_GET['show_all_rev'] ); + + $max_revisions = defined( 'WP_POST_REVISIONS' ) && is_numeric( WP_POST_REVISIONS ) ? (int) WP_POST_REVISIONS : 25; + + $posts_per_page = $show_all_revisions ? $max_revisions : 6; $revisions = new WP_Query( array( 'posts_per_page' => $posts_per_page, @@ -924,7 +924,7 @@ static function revisions_meta_box( $safecss_post ) { ?>found_posts > 6 ) { + if ( $revisions->found_posts > 6 && !$show_all_revisions ) { ?>