Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite Scroll: Don't clobber the posts_per_page option if provided #2808

Merged
merged 1 commit into from
Oct 7, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions modules/infinite-scroll/infinity.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,15 @@ static function get_settings() {
$settings['type'] = 'click';
}

// Ignore posts_per_page theme setting for [click] type
if ( 'click' == $settings['type'] )
$settings['posts_per_page'] = (int) get_option( 'posts_per_page' );

// Backwards compatibility for posts_per_page setting
elseif ( false === $settings['posts_per_page'] )
$settings['posts_per_page'] = 7;
// posts_per_page defaults to 7 for scroll, posts_per_page option for click
if ( false === $settings['posts_per_page'] ) {
if ( 'scroll' === $settings['type'] ) {
$settings['posts_per_page'] = 7;
}
else {
$settings['posts_per_page'] = (int) get_option( 'posts_per_page' );
}
}

// Force display of the click handler and attendant bits when the type isn't `click`
if ( 'click' !== $settings['type'] ) {
Expand Down