Use shorter ABSPATH check

This commit is contained in:
Gary Kealy 2019-06-20 09:57:12 +01:00
parent 30103651df
commit 600eb39883
55 changed files with 116 additions and 171 deletions

View File

@ -5,9 +5,8 @@
* @package understrap
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
get_header();

View File

@ -7,9 +7,8 @@
* @package understrap
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
get_header();

View File

@ -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' );

View File

@ -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

View File

@ -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' );
?>

View File

@ -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.

View File

@ -5,9 +5,8 @@
* @package understrap
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
?>
<?php if ( is_active_sidebar( 'hero' ) || is_active_sidebar( 'statichero' ) || is_active_sidebar( 'herocanvas' ) ) : ?>

View File

@ -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' );
?>

View File

@ -5,9 +5,8 @@
* @package understrap
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
?>
</div><!-- #closing the primary container from /global-templates/left-sidebar-check.php -->

View File

@ -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' );
?>

View File

@ -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

View File

@ -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' );

View File

@ -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' );

View File

@ -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.

View File

@ -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

View File

@ -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.

View File

@ -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' ) ) {
/**

View File

@ -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' );

View File

@ -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' ) ) {
/**

View File

@ -7,9 +7,8 @@
* @package UnderStrap
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
/**
* Jetpack setup function.

View File

@ -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' ) ) {

View File

@ -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 ) ) {

View File

@ -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.

View File

@ -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() {

View File

@ -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.

View File

@ -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' ) ) {

View File

@ -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.

View File

@ -11,9 +11,8 @@
* @package understrap
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
get_header();

View File

@ -5,8 +5,7 @@
* @package understrap
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
the_content();

View File

@ -5,8 +5,7 @@
* @package understrap
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
the_content();

View File

@ -7,9 +7,8 @@
* @package understrap
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
?>
<section class="no-results not-found">

View File

@ -5,9 +5,8 @@
* @package understrap
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
?>
<article <?php post_class(); ?> id="post-<?php the_ID(); ?>">

View File

@ -5,9 +5,8 @@
* @package understrap
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
?>
<article <?php post_class(); ?> id="post-<?php the_ID(); ?>">

View File

@ -5,9 +5,8 @@
* @package understrap
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
?>
<article <?php post_class(); ?> id="post-<?php the_ID(); ?>">

View File

@ -5,9 +5,8 @@
* @package understrap
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
?>
<article <?php post_class(); ?> id="post-<?php the_ID(); ?>">

View File

@ -7,9 +7,8 @@
* @package understrap
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>

View File

@ -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' );

View File

@ -8,9 +8,8 @@
* @package understrap
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
get_header();

View File

@ -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' );

View File

@ -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' );

View File

@ -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' );

View File

@ -10,9 +10,8 @@
* @package understrap
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
get_header();

View File

@ -5,9 +5,8 @@
* @package understrap
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
get_header();

View File

@ -5,9 +5,8 @@
* @package understrap
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
?>
<form method="get" id="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>" role="search">

View File

@ -5,9 +5,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' );

View File

@ -5,9 +5,8 @@
* @package understrap
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
?>
<?php if ( is_active_sidebar( 'hero' ) ) : ?>

View File

@ -5,9 +5,8 @@
* @package understrap
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
?>
<?php if ( is_active_sidebar( 'herocanvas' ) ) : ?>

View File

@ -5,9 +5,8 @@
* @package understrap
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
if ( ! is_active_sidebar( 'left-sidebar' ) ) {
return;

View File

@ -5,9 +5,8 @@
* @package understrap
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
if ( ! is_active_sidebar( 'right-sidebar' ) ) {
return;

View File

@ -5,9 +5,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' );
?>

View File

@ -5,9 +5,8 @@
* @package understrap
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
if ( ! is_active_sidebar( 'sidebar-1' ) ) {
return;

View File

@ -5,9 +5,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' );

View File

@ -18,9 +18,8 @@
* @version 3.6.1
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
?>
<a href="<?php echo esc_url( wc_get_checkout_url() );?>" class="btn btn-primary btn-lg btn-block">

View File

@ -16,9 +16,8 @@
* @version 3.6.1
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
if ( is_user_logged_in() ) {
return;

View File

@ -15,9 +15,8 @@
* @version 3.6.1
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
do_action( 'woocommerce_before_customer_login_form' ); ?>