Skip to content

Commit

Permalink
Merge pull request #1208 from mpeshev/mpinfinite
Browse files Browse the repository at this point in the history
Hide infinite-scroll class if the option is disabled, thanks @mpeshev!
  • Loading branch information
samhotchkiss committed Jan 28, 2015
2 parents a228a5c + 5638175 commit 219791e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions modules/infinite-scroll/infinity.php
Original file line number Diff line number Diff line change
Expand Up @@ -355,10 +355,14 @@ function enqueue_spinner_scripts() {
* Adds an 'infinite-scroll' class to the body.
*/
function body_class( $classes ) {
$classes[] = 'infinite-scroll';

if ( 'scroll' == self::get_settings()->type )
$classes[] = 'neverending';
// Do not add infinity-scroll class if disabled through the Reading page
$disabled = '' === get_option( self::$option_name_enabled ) ? true : false;
if ( ! $disabled ) {
$classes[] = 'infinite-scroll';

if ( 'scroll' == self::get_settings()->type )
$classes[] = 'neverending';
}

return $classes;
}
Expand Down

0 comments on commit 219791e

Please sign in to comment.