Skip to content

Commit

Permalink
different approach to fixing revisions
Browse files Browse the repository at this point in the history
re-introduced the use of wp_revisions_to_keep, but cast the argument as
an object to avoid notice
fixes Automattic#119
  • Loading branch information
mattoperry committed Feb 7, 2014
1 parent 0db2c5a commit 82033ff
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions modules/custom-css/custom-css.php
Original file line number Diff line number Diff line change
Expand Up @@ -889,8 +889,12 @@ static function publish_box() {
static function revisions_meta_box( $safecss_post ) {

$show_all_revisions = isset( $_GET['show_all_rev'] );

$max_revisions = defined( 'WP_POST_REVISIONS' ) && is_numeric( WP_POST_REVISIONS ) ? (int) WP_POST_REVISIONS : 25;

if ( function_exists( 'wp_revisions_to_keep' ) ) {
$max_revisions = wp_revisions_to_keep( (object) $safecss_post );
} else {
$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;

Expand Down

0 comments on commit 82033ff

Please sign in to comment.