From 5638175f0ddccd1b1fe929e82b95b9de92e980b7 Mon Sep 17 00:00:00 2001 From: mpeshev Date: Sun, 19 Oct 2014 18:55:50 +0300 Subject: [PATCH] Hide infinite-scroll class if the option is disabled --- modules/infinite-scroll/infinity.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/infinite-scroll/infinity.php b/modules/infinite-scroll/infinity.php index 3bacfd5b82ead..46b4e51298f89 100644 --- a/modules/infinite-scroll/infinity.php +++ b/modules/infinite-scroll/infinity.php @@ -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; }