diff --git a/wp-includes/comment-functions.php b/wp-includes/comment-functions.php index ce6c2d0e82..280e15035e 100644 --- a/wp-includes/comment-functions.php +++ b/wp-includes/comment-functions.php @@ -855,8 +855,15 @@ function get_page_of_comment( $comment_ID, $args = array() ) { $defaults = array( 'type' => 'all', 'page' => '', 'per_page' => '', 'max_depth' => '' ); $args = wp_parse_args( $args, $defaults ); - if ( '' === $args['per_page'] ) - $args['per_page'] = get_query_var('comments_per_page'); + // Order of precedence: 1. `$args['per_page']`, 2. 'comments_per_page' query_var, 3. 'comments_per_page' option. + if ( '' === $args['per_page'] ) { + $args['per_page'] = get_query_var( 'comments_per_page' ); + } + + if ( '' === $args['per_page'] ) { + $args['per_page'] = get_option( 'comments_per_page' ); + } + if ( empty($args['per_page']) ) { $args['per_page'] = 0; $args['page'] = 0; diff --git a/wp-includes/version.php b/wp-includes/version.php index 2ff85c26c0..84b9461308 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-34805'; +$wp_version = '4.4-alpha-34806'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.