Pārlūkot izejas kodu

Move functions to after theme setup call

Enej Bajgoric 4 gadi atpakaļ
vecāks
revīzija
ecec58072b

+ 10 - 10
alves/functions.php

@@ -107,6 +107,16 @@ if ( ! function_exists( 'alves_setup' ) ) :
 		if ( function_exists( 'varia_mobile_nav_on_side' ) ) {
 			add_filter( 'body_class', 'varia_mobile_nav_on_side' );
 		}
+
+		// Enable the mobile nav on side on theme switch.
+		if ( function_exists( 'varia_enable_mobile_nav_on_side' ) ) {
+			add_action( 'after_switch_theme', 'varia_enable_mobile_nav_on_side' );
+		}
+
+		// Enable the customizer control toggle for the mobile nav on the side.
+		if ( function_exists( 'varia_register_mobile_nav_on_side_customizer_control' ) ) {
+			add_action( 'customize_register' , 'varia_register_mobile_nav_on_side_customizer_control' );
+		}
 	}
 endif;
 add_action( 'after_setup_theme', 'alves_setup', 12 );
@@ -236,13 +246,3 @@ function alves_editor_styles() {
 	}
 }
 add_action( 'enqueue_block_editor_assets', 'alves_editor_styles' );
-
-// Enable the mobile nav on side on theme switch.
-if ( function_exists( 'varia_enable_mobile_nav_on_side' ) ) {
-	add_action( 'after_switch_theme', 'varia_enable_mobile_nav_on_side' );
-}
-
-// Enable the customizer control toggle for the mobile nav on the side.
-if ( function_exists( 'varia_register_mobile_nav_on_side_customizer_control' ) ) {
-	add_action( 'customize_register' , 'varia_register_mobile_nav_on_side_customizer_control' );
-}

+ 10 - 10
barnsbury/functions.php

@@ -107,6 +107,16 @@ if ( ! function_exists( 'barnsbury_setup' ) ) :
 		if ( function_exists( 'varia_mobile_nav_on_side' ) ) {
 			add_filter( 'body_class', 'varia_mobile_nav_on_side' );
 		}
+
+		// Enable the mobile nav on side on theme switch.
+		if ( function_exists( 'varia_enable_mobile_nav_on_side' ) ) {
+			add_action( 'after_switch_theme', 'varia_enable_mobile_nav_on_side' );
+		}
+
+		// Enable the customizer control toggle for the mobile nav on the side.
+		if ( function_exists( 'varia_register_mobile_nav_on_side_customizer_control' ) ) {
+			add_action( 'customize_register' , 'varia_register_mobile_nav_on_side_customizer_control' );
+		}
 	}
 endif;
 add_action( 'after_setup_theme', 'barnsbury_setup', 12 );
@@ -191,13 +201,3 @@ function barnsbury_editor_styles() {
 	}
 }
 add_action( 'enqueue_block_editor_assets', 'barnsbury_editor_styles' );
-
-// Enable the mobile nav on side on theme switch.
-if ( function_exists( 'varia_enable_mobile_nav_on_side' ) ) {
-	add_action( 'after_switch_theme', 'varia_enable_mobile_nav_on_side' );
-}
-
-// Enable the customizer control toggle for the mobile nav on the side.
-if ( function_exists( 'varia_register_mobile_nav_on_side_customizer_control' ) ) {
-	add_action( 'customize_register' , 'varia_register_mobile_nav_on_side_customizer_control' );
-}

+ 10 - 10
dalston/functions.php

@@ -124,6 +124,16 @@ if ( ! function_exists( 'dalston_setup' ) ) :
 		if ( function_exists( 'varia_mobile_nav_on_side' ) ) {
 			add_filter( 'body_class', 'varia_mobile_nav_on_side' );
 		}
+
+		// Enable the mobile nav on side on theme switch.
+		if ( function_exists( 'varia_enable_mobile_nav_on_side' ) ) {
+			add_action( 'after_switch_theme', 'varia_enable_mobile_nav_on_side' );
+		}
+
+		// Enable the customizer control toggle for the mobile nav on the side.
+		if ( function_exists( 'varia_register_mobile_nav_on_side_customizer_control' ) ) {
+			add_action( 'customize_register' , 'varia_register_mobile_nav_on_side_customizer_control' );
+		}
 	}
 endif;
 add_action( 'after_setup_theme', 'dalston_setup', 12 );
@@ -261,13 +271,3 @@ add_action( 'enqueue_block_assets', 'dalston_block_extends' );
 function dalston_is_amp() {
 	return function_exists( 'is_amp_endpoint' ) && is_amp_endpoint();
 }
-
-// Enable the mobile nav on side on theme switch.
-if ( function_exists( 'varia_enable_mobile_nav_on_side' ) ) {
-	add_action( 'after_switch_theme', 'varia_enable_mobile_nav_on_side' );
-}
-
-// Enable the customizer control toggle for the mobile nav on the side.
-if ( function_exists( 'varia_register_mobile_nav_on_side_customizer_control' ) ) {
-	add_action( 'customize_register' , 'varia_register_mobile_nav_on_side_customizer_control' );
-}

+ 10 - 10
hever/functions.php

@@ -104,6 +104,16 @@ if ( ! function_exists( 'hever_setup' ) ) :
 		if ( function_exists( 'varia_mobile_nav_on_side' ) ) {
 			add_filter( 'body_class', 'varia_mobile_nav_on_side' );
 		}
+
+		// Enable the mobile nav on side on theme switch.
+		if ( function_exists( 'varia_enable_mobile_nav_on_side' ) ) {
+			add_action( 'after_switch_theme', 'varia_enable_mobile_nav_on_side' );
+		}
+
+		// Enable the customizer control toggle for the mobile nav on the side.
+		if ( function_exists( 'varia_register_mobile_nav_on_side_customizer_control' ) ) {
+			add_action( 'customize_register' , 'varia_register_mobile_nav_on_side_customizer_control' );
+		}
 	}
 endif;
 add_action( 'after_setup_theme', 'hever_setup', 12 );
@@ -184,13 +194,3 @@ function hever_editor_styles() {
 	wp_enqueue_style( 'hever-editor-fonts', hever_fonts_url(), array(), null );
 }
 add_action( 'enqueue_block_editor_assets', 'hever_editor_styles' );
-
-// Enable the mobile nav on side on theme switch.
-if ( function_exists( 'varia_enable_mobile_nav_on_side' ) ) {
-	add_action( 'after_switch_theme', 'varia_enable_mobile_nav_on_side' );
-}
-
-// Enable the customizer control toggle for the mobile nav on the side.
-if ( function_exists( 'varia_register_mobile_nav_on_side_customizer_control' ) ) {
-	add_action( 'customize_register' , 'varia_register_mobile_nav_on_side_customizer_control' );
-}

+ 10 - 10
mayland/functions.php

@@ -107,6 +107,16 @@ if ( ! function_exists( 'mayland_setup' ) ) :
 		if ( function_exists( 'varia_mobile_nav_on_side' ) ) {
 			add_filter( 'body_class', 'varia_mobile_nav_on_side' );
 		}
+
+		// Enable the mobile nav on side on theme switch.
+		if ( function_exists( 'varia_enable_mobile_nav_on_side' ) ) {
+			add_action( 'after_switch_theme', 'varia_enable_mobile_nav_on_side' );
+		}
+
+		// Enable the customizer control toggle for the mobile nav on the side.
+		if ( function_exists( 'varia_register_mobile_nav_on_side_customizer_control' ) ) {
+			add_action( 'customize_register' , 'varia_register_mobile_nav_on_side_customizer_control' );
+		}
 	}
 endif;
 add_action( 'after_setup_theme', 'mayland_setup', 12 );
@@ -189,13 +199,3 @@ function mayland_editor_styles() {
 	}
 }
 add_action( 'enqueue_block_editor_assets', 'mayland_editor_styles' );
-
-// Enable the mobile nav on side on theme switch.
-if ( function_exists( 'varia_enable_mobile_nav_on_side' ) ) {
-	add_action( 'after_switch_theme', 'varia_enable_mobile_nav_on_side' );
-}
-
-// Enable the customizer control toggle for the mobile nav on the side.
-if ( function_exists( 'varia_register_mobile_nav_on_side_customizer_control' ) ) {
-	add_action( 'customize_register' , 'varia_register_mobile_nav_on_side_customizer_control' );
-}

+ 10 - 10
morden/functions.php

@@ -104,6 +104,16 @@ if ( ! function_exists( 'morden_setup' ) ) :
 		if ( function_exists( 'varia_mobile_nav_on_side' ) ) {
 			add_filter( 'body_class', 'varia_mobile_nav_on_side' );
 		}
+
+		// Enable the mobile nav on side on theme switch.
+		if ( function_exists( 'varia_enable_mobile_nav_on_side' ) ) {
+			add_action( 'after_switch_theme', 'varia_enable_mobile_nav_on_side' );
+		}
+
+		// Enable the customizer control toggle for the mobile nav on the side.
+		if ( function_exists( 'varia_register_mobile_nav_on_side_customizer_control' ) ) {
+			add_action( 'customize_register' , 'varia_register_mobile_nav_on_side_customizer_control' );
+		}
 	}
 endif;
 add_action( 'after_setup_theme', 'morden_setup', 12 );
@@ -183,13 +193,3 @@ function morden_editor_styles() {
 	wp_enqueue_style( 'morden-editor-fonts', morden_fonts_url(), array(), null );
 }
 add_action( 'enqueue_block_editor_assets', 'morden_editor_styles' );
-
-// Enable the mobile nav on side on theme switch.
-if ( function_exists( 'varia_enable_mobile_nav_on_side' ) ) {
-	add_action( 'after_switch_theme', 'varia_enable_mobile_nav_on_side' );
-}
-
-// Enable the customizer control toggle for the mobile nav on the side.
-if ( function_exists( 'varia_register_mobile_nav_on_side_customizer_control' ) ) {
-	add_action( 'customize_register' , 'varia_register_mobile_nav_on_side_customizer_control' );
-}

+ 10 - 10
rivington/functions.php

@@ -116,6 +116,16 @@ if ( ! function_exists( 'rivington_setup' ) ) :
 		if ( function_exists( 'varia_mobile_nav_on_side' ) ) {
 			add_filter( 'body_class', 'varia_mobile_nav_on_side' );
 		}
+
+		// Enable the mobile nav on side on theme switch.
+		if ( function_exists( 'varia_enable_mobile_nav_on_side' ) ) {
+			add_action( 'after_switch_theme', 'varia_enable_mobile_nav_on_side' );
+		}
+
+		// Enable the customizer control toggle for the mobile nav on the side.
+		if ( function_exists( 'varia_register_mobile_nav_on_side_customizer_control' ) ) {
+			add_action( 'customize_register' , 'varia_register_mobile_nav_on_side_customizer_control' );
+		}
 	}
 endif;
 add_action( 'after_setup_theme', 'rivington_setup', 12 );
@@ -198,13 +208,3 @@ function rivington_editor_styles() {
 	}
 }
 add_action( 'enqueue_block_editor_assets', 'rivington_editor_styles' );
-
-// Enable the mobile nav on side on theme switch.
-if ( function_exists( 'varia_enable_mobile_nav_on_side' ) ) {
-	add_action( 'after_switch_theme', 'varia_enable_mobile_nav_on_side' );
-}
-
-// Enable the customizer control toggle for the mobile nav on the side.
-if ( function_exists( 'varia_register_mobile_nav_on_side_customizer_control' ) ) {
-	add_action( 'customize_register' , 'varia_register_mobile_nav_on_side_customizer_control' );
-}

+ 2 - 2
varia/functions.php

@@ -295,8 +295,8 @@ if ( ! function_exists( 'varia_mobile_nav_on_side' ) ) {
 	}
 }
 
-if ( ! function_exists( 'varia_enable_side_menu_on_mobile' ) ) {
-	function varia_enable_side_menu_on_mobile() {
+if ( ! function_exists( 'varia_enable_mobile_nav_on_side' ) ) {
+	function varia_enable_mobile_nav_on_side() {
 		set_theme_mod( 'enable_side_menu', 1 );
 	}
 }