浏览代码

Include the varia_mobile_nav_on_side function in all the themes.

This makes sure that the user will not get a PHP warning if theu are not running the latest version of varia that has that function.
Since varia doesn't have that feature enabled this PR removes the function as well.
Enej Bajgoric 4 年之前
父节点
当前提交
7fa2ec4ff3
共有 8 个文件被更改,包括 56 次插入16 次删除
  1. 8 1
      alves/functions.php
  2. 8 1
      barnsbury/functions.php
  3. 7 1
      dalston/functions.php
  4. 8 1
      hever/functions.php
  5. 8 1
      mayland/functions.php
  6. 8 1
      morden/functions.php
  7. 9 1
      rivington/functions.php
  8. 0 9
      varia/functions.php

+ 8 - 1
alves/functions.php

@@ -102,7 +102,7 @@ if ( ! function_exists( 'alves_setup' ) ) :
 				),
 			)
 		);
-		// Add mobile-on-side body class.
+		// Add .mobile-nav-side body class.
 		add_filter( 'body_class', 'varia_mobile_nav_on_side' );
 	}
 endif;
@@ -233,3 +233,10 @@ function alves_editor_styles() {
 	}
 }
 add_action( 'enqueue_block_editor_assets', 'alves_editor_styles' );
+
+// This makes it possible to define the function in earlier to alter if the class should be applied or not.
+if ( ! function_exists( 'varia_mobile_nav_on_side' ) ) {
+	function varia_mobile_nav_on_side( $classes ) {
+		return array_merge( $classes, array( 'mobile-nav-side' ) );
+	}
+}

+ 8 - 1
barnsbury/functions.php

@@ -103,7 +103,7 @@ if ( ! function_exists( 'barnsbury_setup' ) ) :
 			)
 		);
 
-		// Add mobile-on-side body class.
+		// Add .mobile-nav-side body class.
 		add_filter( 'body_class', 'varia_mobile_nav_on_side' );
 	}
 endif;
@@ -190,3 +190,10 @@ function barnsbury_editor_styles() {
 }
 add_action( 'enqueue_block_editor_assets', 'barnsbury_editor_styles' );
 
+// This makes it possible to define the function in earlier to alter if the class should be applied or not.
+if ( ! function_exists( 'varia_mobile_nav_on_side' ) ) {
+	function varia_mobile_nav_on_side( $classes ) {
+		return array_merge( $classes, array( 'mobile-nav-side' ) );
+	}
+}
+

+ 7 - 1
dalston/functions.php

@@ -120,7 +120,7 @@ if ( ! function_exists( 'dalston_setup' ) ) :
 			)
 		);
 
-		// Add mobile-on-side body class.
+		// Add .mobile-nav-side body class.
 		add_filter( 'body_class', 'varia_mobile_nav_on_side' );
 	}
 endif;
@@ -260,3 +260,9 @@ function dalston_is_amp() {
 	return function_exists( 'is_amp_endpoint' ) && is_amp_endpoint();
 }
 
+// This makes it possible to define the function in earlier to alter if the class should be applied or not.
+if ( ! function_exists( 'varia_mobile_nav_on_side' ) ) {
+	function varia_mobile_nav_on_side( $classes ) {
+		return array_merge( $classes, array( 'mobile-nav-side' ) );
+	}
+}

+ 8 - 1
hever/functions.php

@@ -100,7 +100,7 @@ if ( ! function_exists( 'hever_setup' ) ) :
 			)
 		);
 
-		// Add mobile-on-side body class.
+		// Add .mobile-nav-side body class.
 		add_filter( 'body_class', 'varia_mobile_nav_on_side' );
 	}
 endif;
@@ -182,3 +182,10 @@ function hever_editor_styles() {
 	wp_enqueue_style( 'hever-editor-fonts', hever_fonts_url(), array(), null );
 }
 add_action( 'enqueue_block_editor_assets', 'hever_editor_styles' );
+
+// This makes it possible to define the function in earlier to alter if the class should be applied or not.
+if ( ! function_exists( 'varia_mobile_nav_on_side' ) ) {
+	function varia_mobile_nav_on_side( $classes ) {
+		return array_merge( $classes, array( 'mobile-nav-side' ) );
+	}
+}

+ 8 - 1
mayland/functions.php

@@ -103,7 +103,7 @@ if ( ! function_exists( 'mayland_setup' ) ) :
 			)
 		);
 
-		// Add mobile-on-side body class.
+		// Add .mobile-nav-side body class.
 		add_filter( 'body_class', 'varia_mobile_nav_on_side' );
 	}
 endif;
@@ -187,3 +187,10 @@ function mayland_editor_styles() {
 	}
 }
 add_action( 'enqueue_block_editor_assets', 'mayland_editor_styles' );
+
+// This makes it possible to define the function in earlier to alter if the class should be applied or not.
+if ( ! function_exists( 'varia_mobile_nav_on_side' ) ) {
+	function varia_mobile_nav_on_side( $classes ) {
+		return array_merge( $classes, array( 'mobile-nav-side' ) );
+	}
+}

+ 8 - 1
morden/functions.php

@@ -100,7 +100,7 @@ if ( ! function_exists( 'morden_setup' ) ) :
 			)
 		);
 
-		// Add mobile-on-side body class.
+		// Add .mobile-nav-side body class.
 		add_filter( 'body_class', 'varia_mobile_nav_on_side' );
 	}
 endif;
@@ -181,3 +181,10 @@ function morden_editor_styles() {
 	wp_enqueue_style( 'morden-editor-fonts', morden_fonts_url(), array(), null );
 }
 add_action( 'enqueue_block_editor_assets', 'morden_editor_styles' );
+
+// This makes it possible to define the function in earlier to alter if the class should be applied or not.
+if ( ! function_exists( 'varia_mobile_nav_on_side' ) ) {
+	function varia_mobile_nav_on_side( $classes ) {
+		return array_merge( $classes, array( 'mobile-nav-side' ) );
+	}
+}

+ 9 - 1
rivington/functions.php

@@ -112,7 +112,7 @@ if ( ! function_exists( 'rivington_setup' ) ) :
 		// Remove footer menu
 		unregister_nav_menu( 'menu-2' );
 
-		// Add mobile-on-side body class.
+		// Add .mobile-nav-side body class.
 		add_filter( 'body_class', 'varia_mobile_nav_on_side' );
 	}
 endif;
@@ -196,3 +196,11 @@ function rivington_editor_styles() {
 	}
 }
 add_action( 'enqueue_block_editor_assets', 'rivington_editor_styles' );
+
+// This makes it possible to define the function in earlier to alter if the class should be applied or not.
+if ( ! function_exists( 'varia_mobile_nav_on_side' ) ) {
+	function varia_mobile_nav_on_side( $classes ) {
+		return array_merge( $classes, array( 'mobile-nav-side' ) );
+	}
+}
+

+ 0 - 9
varia/functions.php

@@ -285,15 +285,6 @@ function varia_editor_content_width() {
 }
 add_action( 'enqueue_block_editor_assets', 'varia_editor_content_width' );
 
-// This makes it possible to define the function in earlier to alter if the class should be applied or not.
-if ( ! function_exists( 'varia_mobile_nav_on_side' ) ) {
-	function varia_mobile_nav_on_side( $classes ) {
-		return array_merge( $classes, array( 'mobile-nav-side' ) );
-	}
-}
-// Add this filter to the theme that you want to have the side navigation applied for.
-// add_filter( 'body_class', 'varia_mobile_nav_on_side' );
-
 /**
  * SVG Icons class.
  */