From 0b4092519dfe629268a8d9e2ee58353fed52ff53 Mon Sep 17 00:00:00 2001 From: Nikita Dudarev Date: Wed, 1 May 2019 13:42:19 +0300 Subject: [PATCH 1/3] updating theme boilerplate for WP 5.2 --- inc/helpers.php | 8 ++++++++ views/layouts/html.php | 1 + 2 files changed, 9 insertions(+) diff --git a/inc/helpers.php b/inc/helpers.php index f1c67f0..80c2f04 100644 --- a/inc/helpers.php +++ b/inc/helpers.php @@ -5,3 +5,11 @@ * For example, it can be some kind of date formatters, array sorters, etc. */ +/** + * Support previous versions of WordPress. + */ +if ( ! function_exists( 'wp_body_open' ) ) { + function wp_body_open() { + do_action( 'wp_body_open' ); + } +} diff --git a/views/layouts/html.php b/views/layouts/html.php index a5637ff..1e7fec7 100644 --- a/views/layouts/html.php +++ b/views/layouts/html.php @@ -15,6 +15,7 @@ > +
From ce5a3177e897d924d27f148e5b7bf00231629272 Mon Sep 17 00:00:00 2001 From: Nikita Dudarev Date: Wed, 1 May 2019 15:18:54 +0300 Subject: [PATCH 2/3] wp_body_open hook has been moved to hooks.php --- inc/helpers.php | 9 --------- inc/hooks.php | 9 +++++++++ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/inc/helpers.php b/inc/helpers.php index 80c2f04..9a99f22 100644 --- a/inc/helpers.php +++ b/inc/helpers.php @@ -4,12 +4,3 @@ * * For example, it can be some kind of date formatters, array sorters, etc. */ - -/** - * Support previous versions of WordPress. - */ -if ( ! function_exists( 'wp_body_open' ) ) { - function wp_body_open() { - do_action( 'wp_body_open' ); - } -} diff --git a/inc/hooks.php b/inc/hooks.php index 090f27f..948f357 100644 --- a/inc/hooks.php +++ b/inc/hooks.php @@ -20,6 +20,15 @@ function boilerplate_body_classes( $classes ) { return $classes; } +/** + * Support previous versions of WordPress. + */ +if ( ! function_exists( 'wp_body_open' ) ) { + function wp_body_open() { + do_action( 'wp_body_open' ); + } +} + add_filter( 'body_class', 'boilerplate_body_classes' ); //Remove emoji From 66954cfd1418888182e3a8e66266bff064b6450d Mon Sep 17 00:00:00 2001 From: Nikita Dudarev Date: Wed, 1 May 2019 15:20:31 +0300 Subject: [PATCH 3/3] update code --- inc/hooks.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/hooks.php b/inc/hooks.php index 948f357..dff443a 100644 --- a/inc/hooks.php +++ b/inc/hooks.php @@ -20,6 +20,8 @@ function boilerplate_body_classes( $classes ) { return $classes; } +add_filter( 'body_class', 'boilerplate_body_classes' ); + /** * Support previous versions of WordPress. */ @@ -29,8 +31,6 @@ function wp_body_open() { } } -add_filter( 'body_class', 'boilerplate_body_classes' ); - //Remove emoji remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );