diff --git a/docs/developers/constants.rst b/docs/developers/constants.rst index b542bee11..e1f31099b 100644 --- a/docs/developers/constants.rst +++ b/docs/developers/constants.rst @@ -73,7 +73,9 @@ The other constants .. php:const:: SHOW_STICKY_NAV - The sticky nav appears on the homepage and all internal pages, and on mobile devices, governed by ``SHOW_STICKY_NAV``. ``SHOW_STICKY_NAV`` my be defined to be true or false, but the easiest way to set it is to check "Show the Sticky Nav" in the Theme Options section of Largo. + **DEPRECATED** in Largo version 0.5.5. Conditional logic based on this constant should remove the conditional logic, and make sure that the HTML stucture is similar to that of `partials/nav_sticky.php `_. The element ``#sticky-nav-holder`` will be shown or hidden by `navigation.js `_. + + The sticky nav used to appear on the homepage and all internal pages, and on mobile devices, governed by ``SHOW_STICKY_NAV``. ``SHOW_STICKY_NAV`` may be defined to be true or false. .. php:const:: SHOW_MAIN_NAV diff --git a/functions.php b/functions.php index 9e6119f9a..1859f1c2c 100644 --- a/functions.php +++ b/functions.php @@ -296,12 +296,13 @@ private function template_constants() { if ( ! defined( 'SHOW_GLOBAL_NAV' ) ) { define( 'SHOW_GLOBAL_NAV', TRUE ); } + /* + * SHOW_STICKY_NAV is deprecated. + * @link https://github.com/INN/Largo/issues/1135 + * @since 0.5.5 + */ if ( ! defined( 'SHOW_STICKY_NAV' ) ) { - if ( of_get_option( 'show_sticky_nav' ) ) { - define( 'SHOW_STICKY_NAV', TRUE ); - } else { - define( 'SHOW_STICKY_NAV', FALSE ); - } + define( 'SHOW_STICKY_NAV', FALSE ); } if ( ! defined( 'SHOW_MAIN_NAV' ) ) { define( 'SHOW_MAIN_NAV', TRUE ); diff --git a/inc/header-footer.php b/inc/header-footer.php index 7df3173f0..10493c9fd 100644 --- a/inc/header-footer.php +++ b/inc/header-footer.php @@ -1,17 +1,20 @@ __('Show the sticky nav? Default is to show, but in some cases you may want to hide it.'), - 'id' => 'show_sticky_nav', - 'std' => '1', - 'type' => 'checkbox'); $options[] = array( 'desc' => __('Starting with version 0.4, Largo introduced a new single-post template that more prominently highlights article content, which is the default. For backward compatibility, the pre-0.3 version is also available.', 'largo'), 'id' => 'single_template', diff --git a/tests/inc/test-update.php b/tests/inc/test-update.php index 54fe48c58..e5d7e8c95 100644 --- a/tests/inc/test-update.php +++ b/tests/inc/test-update.php @@ -359,7 +359,6 @@ function test_largo_update_prominence_term_descriptions() { function test_largo_force_settings_update() { of_reset_options(); largo_force_settings_update(); - $this->assertEquals('1', of_get_option('show_sticky_nav')); $this->assertEquals('normal', of_get_option('single_template')); }