From 600eb39883ec71c232a337ab9143d5ba08a5d3fb Mon Sep 17 00:00:00 2001 From: Gary Kealy Date: Thu, 20 Jun 2019 09:57:12 +0100 Subject: [PATCH] Use shorter ABSPATH check --- 404.php | 5 ++--- archive.php | 5 ++--- author.php | 9 ++++----- comments.php | 5 ++--- footer.php | 5 ++--- functions.php | 5 ++--- global-templates/hero.php | 5 ++--- global-templates/left-sidebar-check.php | 5 ++--- global-templates/right-sidebar-check.php | 5 ++--- header.php | 5 ++--- inc/class-wp-bootstrap-navwalker.php | 5 ++--- inc/custom-comments.php | 5 ++--- inc/custom-header.php | 5 ++--- inc/customizer.php | 5 ++--- inc/deprecated.php | 11 +++++------ inc/editor.php | 5 ++--- inc/enqueue.php | 5 ++--- inc/extras.php | 5 ++--- inc/hooks.php | 5 ++--- inc/jetpack.php | 5 ++--- inc/pagination.php | 5 ++--- inc/setup.php | 5 ++--- inc/template-tags.php | 5 ++--- inc/theme-settings.php | 5 ++--- inc/widgets.php | 5 ++--- inc/woocommerce.php | 5 ++--- inc/wpcom.php | 5 ++--- index.php | 5 ++--- loop-templates/content-blank.php | 5 ++--- loop-templates/content-empty.php | 5 ++--- loop-templates/content-none.php | 7 +++---- loop-templates/content-page.php | 5 ++--- loop-templates/content-search.php | 5 ++--- loop-templates/content-single.php | 5 ++--- loop-templates/content.php | 5 ++--- page-templates/blank.php | 5 ++--- page-templates/both-sidebarspage.php | 5 ++--- page-templates/empty.php | 5 ++--- page-templates/fullwidthpage.php | 5 ++--- page-templates/left-sidebarpage.php | 5 ++--- page-templates/right-sidebarpage.php | 5 ++--- page.php | 5 ++--- search.php | 5 ++--- searchform.php | 5 ++--- sidebar-templates/sidebar-footerfull.php | 5 ++--- sidebar-templates/sidebar-hero.php | 5 ++--- sidebar-templates/sidebar-herocanvas.php | 5 ++--- sidebar-templates/sidebar-left.php | 5 ++--- sidebar-templates/sidebar-right.php | 5 ++--- sidebar-templates/sidebar-statichero.php | 5 ++--- sidebar.php | 5 ++--- single.php | 5 ++--- woocommerce/cart/proceed-to-checkout-button.php | 5 ++--- woocommerce/global/form-login.php | 5 ++--- woocommerce/myaccount/form-login.php | 5 ++--- 55 files changed, 116 insertions(+), 171 deletions(-) diff --git a/404.php b/404.php index 53ce3ad..6a12926 100644 --- a/404.php +++ b/404.php @@ -5,9 +5,8 @@ * @package understrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; get_header(); diff --git a/archive.php b/archive.php index 49443f7..6e3ba74 100644 --- a/archive.php +++ b/archive.php @@ -7,9 +7,8 @@ * @package understrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; get_header(); diff --git a/author.php b/author.php index 080d972..032f3cd 100644 --- a/author.php +++ b/author.php @@ -7,9 +7,8 @@ * @package understrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; get_header(); $container = get_theme_mod( 'understrap_container_type' ); @@ -76,8 +75,8 @@ $container = get_theme_mod( 'understrap_container_type' ); the_title( '', '', false ) ); ?> - - + + diff --git a/comments.php b/comments.php index b8a1c00..205e7af 100644 --- a/comments.php +++ b/comments.php @@ -8,9 +8,8 @@ * @package understrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; /* * If the current post is protected by a password and diff --git a/footer.php b/footer.php index 92c7be0..d257cfa 100644 --- a/footer.php +++ b/footer.php @@ -7,9 +7,8 @@ * @package understrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; $container = get_theme_mod( 'understrap_container_type' ); ?> diff --git a/functions.php b/functions.php index 864a906..5333aa8 100644 --- a/functions.php +++ b/functions.php @@ -5,9 +5,8 @@ * @package understrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; $understrap_includes = array( '/theme-settings.php', // Initialize theme default settings. diff --git a/global-templates/hero.php b/global-templates/hero.php index 18242b9..a8fd655 100644 --- a/global-templates/hero.php +++ b/global-templates/hero.php @@ -5,9 +5,8 @@ * @package understrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; ?> diff --git a/global-templates/left-sidebar-check.php b/global-templates/left-sidebar-check.php index 3ac77bf..3592d57 100644 --- a/global-templates/left-sidebar-check.php +++ b/global-templates/left-sidebar-check.php @@ -5,9 +5,8 @@ * @package understrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; $sidebar_pos = get_theme_mod( 'understrap_sidebar_position' ); ?> diff --git a/global-templates/right-sidebar-check.php b/global-templates/right-sidebar-check.php index 826baab..fe61c5a 100644 --- a/global-templates/right-sidebar-check.php +++ b/global-templates/right-sidebar-check.php @@ -5,9 +5,8 @@ * @package understrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; ?> diff --git a/header.php b/header.php index b9244e5..f19f527 100644 --- a/header.php +++ b/header.php @@ -7,9 +7,8 @@ * @package understrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; $container = get_theme_mod( 'understrap_container_type' ); ?> diff --git a/inc/class-wp-bootstrap-navwalker.php b/inc/class-wp-bootstrap-navwalker.php index 7deeca2..16af9bc 100644 --- a/inc/class-wp-bootstrap-navwalker.php +++ b/inc/class-wp-bootstrap-navwalker.php @@ -5,9 +5,8 @@ * @package WP-Bootstrap-Navwalker */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; /* * Class Name: WP_Bootstrap_Navwalker diff --git a/inc/custom-comments.php b/inc/custom-comments.php index d616cf6..043ad3c 100644 --- a/inc/custom-comments.php +++ b/inc/custom-comments.php @@ -5,9 +5,8 @@ * @package understrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; // Comments form. add_filter( 'comment_form_default_fields', 'understrap_bootstrap_comment_form_fields' ); diff --git a/inc/custom-header.php b/inc/custom-header.php index b711882..8178a3d 100644 --- a/inc/custom-header.php +++ b/inc/custom-header.php @@ -5,9 +5,8 @@ * @package understrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; add_action( 'after_setup_theme', 'understrap_custom_header_setup' ); diff --git a/inc/customizer.php b/inc/customizer.php index c774f43..4d5ef1f 100644 --- a/inc/customizer.php +++ b/inc/customizer.php @@ -5,9 +5,8 @@ * @package understrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; /** * Add postMessage support for site title and description for the Theme Customizer. diff --git a/inc/deprecated.php b/inc/deprecated.php index a9608f6..ebe3eb3 100644 --- a/inc/deprecated.php +++ b/inc/deprecated.php @@ -5,9 +5,8 @@ * @package understrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; /** * Count number of widgets in a sidebar @@ -34,7 +33,7 @@ if ( ! function_exists( 'understrap_slbd_count_widgets' ) ) { // If two widgets are published $widget_classes .= ' col-md-2'; elseif ( $widget_count >= 3 ) : - // Three widgets per row if there's three or more widgets + // Three widgets per row if there's three or more widgets $widget_classes .= ' col-md-4'; elseif ( 2 == $widget_count ) : // If two widgets are published @@ -42,8 +41,8 @@ if ( ! function_exists( 'understrap_slbd_count_widgets' ) ) { elseif ( 1 == $widget_count ) : // If just on widget is active $widget_classes .= ' col-md-12'; - endif; + endif; return $widget_classes; endif; } -} \ No newline at end of file +} diff --git a/inc/editor.php b/inc/editor.php index 826e21a..2ed1370 100644 --- a/inc/editor.php +++ b/inc/editor.php @@ -5,9 +5,8 @@ * @package understrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; /** * Registers an editor stylesheet for the theme. diff --git a/inc/enqueue.php b/inc/enqueue.php index 7ef20a1..abcfd3d 100644 --- a/inc/enqueue.php +++ b/inc/enqueue.php @@ -5,9 +5,8 @@ * @package understrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; if ( ! function_exists( 'understrap_scripts' ) ) { /** diff --git a/inc/extras.php b/inc/extras.php index 88d87d5..9cb5cb5 100644 --- a/inc/extras.php +++ b/inc/extras.php @@ -7,9 +7,8 @@ * @package understrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; add_filter( 'body_class', 'understrap_body_classes' ); diff --git a/inc/hooks.php b/inc/hooks.php index e6752a5..6ce80fd 100644 --- a/inc/hooks.php +++ b/inc/hooks.php @@ -5,9 +5,8 @@ * @package understrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; if ( ! function_exists( 'understrap_site_info' ) ) { /** diff --git a/inc/jetpack.php b/inc/jetpack.php index 73c8e04..f91982f 100644 --- a/inc/jetpack.php +++ b/inc/jetpack.php @@ -7,9 +7,8 @@ * @package UnderStrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; /** * Jetpack setup function. diff --git a/inc/pagination.php b/inc/pagination.php index 2e9dfa5..fadc462 100644 --- a/inc/pagination.php +++ b/inc/pagination.php @@ -5,9 +5,8 @@ * @package understrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; if ( ! function_exists( 'understrap_pagination' ) ) { diff --git a/inc/setup.php b/inc/setup.php index a7eed29..0a22660 100644 --- a/inc/setup.php +++ b/inc/setup.php @@ -5,9 +5,8 @@ * @package understrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; // Set the content width based on the theme's design and stylesheet. if ( ! isset( $content_width ) ) { diff --git a/inc/template-tags.php b/inc/template-tags.php index eb3f8c1..2beb880 100644 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -7,9 +7,8 @@ * @package understrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; /** * Prints HTML with meta information for the current post-date/time and author. diff --git a/inc/theme-settings.php b/inc/theme-settings.php index 0d2447d..d67fb58 100755 --- a/inc/theme-settings.php +++ b/inc/theme-settings.php @@ -5,9 +5,8 @@ * @package understrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; if ( ! function_exists( 'understrap_setup_theme_default_settings' ) ) { function understrap_setup_theme_default_settings() { diff --git a/inc/widgets.php b/inc/widgets.php index 8868a98..5523b11 100644 --- a/inc/widgets.php +++ b/inc/widgets.php @@ -5,9 +5,8 @@ * @package understrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; /** * Add filter to the parameters passed to a widget's display callback. diff --git a/inc/woocommerce.php b/inc/woocommerce.php index c858df8..fe284d2 100644 --- a/inc/woocommerce.php +++ b/inc/woocommerce.php @@ -5,9 +5,8 @@ * @package understrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; add_action( 'after_setup_theme', 'understrap_woocommerce_support' ); if ( ! function_exists( 'understrap_woocommerce_support' ) ) { diff --git a/inc/wpcom.php b/inc/wpcom.php index 772bb6d..4f40f01 100644 --- a/inc/wpcom.php +++ b/inc/wpcom.php @@ -7,9 +7,8 @@ * @package understrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; /** * Adds support for wp.com-specific theme functions. diff --git a/index.php b/index.php index c7acb4c..c5e4417 100644 --- a/index.php +++ b/index.php @@ -11,9 +11,8 @@ * @package understrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; get_header(); diff --git a/loop-templates/content-blank.php b/loop-templates/content-blank.php index 01ff3af..fe0cc8e 100644 --- a/loop-templates/content-blank.php +++ b/loop-templates/content-blank.php @@ -5,8 +5,7 @@ * @package understrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; the_content(); diff --git a/loop-templates/content-empty.php b/loop-templates/content-empty.php index 5681144..6dac115 100644 --- a/loop-templates/content-empty.php +++ b/loop-templates/content-empty.php @@ -5,8 +5,7 @@ * @package understrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; the_content(); diff --git a/loop-templates/content-none.php b/loop-templates/content-none.php index 250152a..861a274 100644 --- a/loop-templates/content-none.php +++ b/loop-templates/content-none.php @@ -7,9 +7,8 @@ * @package understrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; ?>
@@ -43,5 +42,5 @@ if ( ! defined( 'ABSPATH' ) ) { get_search_form(); endif; ?> - +
diff --git a/loop-templates/content-page.php b/loop-templates/content-page.php index a2febee..6a2f74e 100644 --- a/loop-templates/content-page.php +++ b/loop-templates/content-page.php @@ -5,9 +5,8 @@ * @package understrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; ?>
id="post-"> diff --git a/loop-templates/content-search.php b/loop-templates/content-search.php index cfb8c48..df5288c 100644 --- a/loop-templates/content-search.php +++ b/loop-templates/content-search.php @@ -5,9 +5,8 @@ * @package understrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; ?>
id="post-"> diff --git a/loop-templates/content-single.php b/loop-templates/content-single.php index 7c2ad9e..2f39215 100644 --- a/loop-templates/content-single.php +++ b/loop-templates/content-single.php @@ -5,9 +5,8 @@ * @package understrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; ?>
id="post-"> diff --git a/loop-templates/content.php b/loop-templates/content.php index 3f98975..b0d24b7 100644 --- a/loop-templates/content.php +++ b/loop-templates/content.php @@ -5,9 +5,8 @@ * @package understrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; ?>
id="post-"> diff --git a/page-templates/blank.php b/page-templates/blank.php index 58e79a8..cb58a77 100644 --- a/page-templates/blank.php +++ b/page-templates/blank.php @@ -7,9 +7,8 @@ * @package understrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; ?> > diff --git a/page-templates/both-sidebarspage.php b/page-templates/both-sidebarspage.php index 40b513a..1338621 100644 --- a/page-templates/both-sidebarspage.php +++ b/page-templates/both-sidebarspage.php @@ -7,9 +7,8 @@ * @package understrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; get_header(); $container = get_theme_mod( 'understrap_container_type' ); diff --git a/page-templates/empty.php b/page-templates/empty.php index 9a5a66b..432a892 100644 --- a/page-templates/empty.php +++ b/page-templates/empty.php @@ -8,9 +8,8 @@ * @package understrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; get_header(); diff --git a/page-templates/fullwidthpage.php b/page-templates/fullwidthpage.php index 6f55fdb..05a4f0c 100644 --- a/page-templates/fullwidthpage.php +++ b/page-templates/fullwidthpage.php @@ -7,9 +7,8 @@ * @package understrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; get_header(); $container = get_theme_mod( 'understrap_container_type' ); diff --git a/page-templates/left-sidebarpage.php b/page-templates/left-sidebarpage.php index 2273dc1..1a76aee 100644 --- a/page-templates/left-sidebarpage.php +++ b/page-templates/left-sidebarpage.php @@ -7,9 +7,8 @@ * @package understrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; get_header(); $container = get_theme_mod( 'understrap_container_type' ); diff --git a/page-templates/right-sidebarpage.php b/page-templates/right-sidebarpage.php index f5bb153..1dd58b1 100644 --- a/page-templates/right-sidebarpage.php +++ b/page-templates/right-sidebarpage.php @@ -7,9 +7,8 @@ * @package understrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; get_header(); $container = get_theme_mod( 'understrap_container_type' ); diff --git a/page.php b/page.php index cf99c6b..e9c1621 100644 --- a/page.php +++ b/page.php @@ -10,9 +10,8 @@ * @package understrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; get_header(); diff --git a/search.php b/search.php index f1699f7..205b880 100644 --- a/search.php +++ b/search.php @@ -5,9 +5,8 @@ * @package understrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; get_header(); diff --git a/searchform.php b/searchform.php index f1c76e0..b1239fd 100644 --- a/searchform.php +++ b/searchform.php @@ -5,9 +5,8 @@ * @package understrap */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; ?>