File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -711,20 +711,26 @@ public function sanitize_scroll_to_top_side( $value ) {
711711 */
712712 public static function is_enabled () {
713713 // Check old option first for backward compatibility.
714- $ old_value = get_option ( 'nv_pro_scroll_to_top_status ' , null );
714+ $ old_value = get_option ( 'nv_pro_scroll_to_top_status ' , null );
715+ $ is_enabled = false ;
715716
716717 if ( null !== $ old_value ) {
717718 // Option exists — use it and migrate to the new theme_mod for future.
718- $ value = $ old_value === '1 ' ;
719+ $ is_enabled = $ old_value === '1 ' ;
719720
720721 set_theme_mod ( 'neve_scroll_to_top_status ' , $ old_value );
721722 delete_option ( 'nv_pro_scroll_to_top_status ' );
722-
723- return $ value ;
723+ } else {
724+ // Otherwise, use the new theme_mod.
725+ $ is_enabled = get_theme_mod ( 'neve_scroll_to_top_status ' , '1 ' ) === '1 ' ;
724726 }
725727
726- // Otherwise, use the new theme_mod.
727- return get_theme_mod ( 'neve_scroll_to_top_status ' , '1 ' ) === '1 ' ;
728+ /**
729+ * Filter to allow conditional loading of the scroll to top feature.
730+ *
731+ * @param bool $is_enabled Whether the scroll to top feature is enabled.
732+ */
733+ return apply_filters ( 'neve_scroll_to_top_is_enabled ' , $ is_enabled );
728734 }
729735
730736 /**
You can’t perform that action at this time.
0 commit comments