From 464086a40b688e5a62d5fe5535f6580b39190ed1 Mon Sep 17 00:00:00 2001 From: koenemann Date: Mon, 27 Nov 2017 09:07:11 +0100 Subject: [PATCH] Update prefixes --- inc/extras.php | 12 ++++++------ inc/jetpack.php | 8 ++++---- inc/security.php | 44 ------------------------------------------ inc/setup.php | 12 ++++++------ inc/theme-settings.php | 4 ++-- inc/widgets.php | 4 ++-- inc/woocommerce.php | 6 +++--- 7 files changed, 23 insertions(+), 67 deletions(-) delete mode 100644 inc/security.php diff --git a/inc/extras.php b/inc/extras.php index ad1b5f0..1f6ef01 100644 --- a/inc/extras.php +++ b/inc/extras.php @@ -31,9 +31,9 @@ if ( ! function_exists( 'understrap_body_classes' ) ) { add_filter( 'body_class', 'understrap_body_classes' ); // Removes tag class from the body_class array to avoid Bootstrap markup styling issues. -add_filter( 'body_class', 'adjust_body_class' ); +add_filter( 'body_class', 'understrap_adjust_body_class' ); -if ( ! function_exists( 'adjust_body_class' ) ) { +if ( ! function_exists( 'understrap_adjust_body_class' ) ) { /** * Setup body classes. * @@ -41,7 +41,7 @@ if ( ! function_exists( 'adjust_body_class' ) ) { * * @return mixed */ - function adjust_body_class( $classes ) { + function understrap_adjust_body_class( $classes ) { foreach ( $classes as $key => $value ) { if ( 'tag' == $value ) { @@ -55,9 +55,9 @@ if ( ! function_exists( 'adjust_body_class' ) ) { } // Filter custom logo with correct classes. -add_filter( 'get_custom_logo', 'change_logo_class' ); +add_filter( 'get_custom_logo', 'understrap_change_logo_class' ); -if ( ! function_exists( 'change_logo_class' ) ) { +if ( ! function_exists( 'understrap_change_logo_class' ) ) { /** * Replaces logo CSS class. * @@ -65,7 +65,7 @@ if ( ! function_exists( 'change_logo_class' ) ) { * * @return mixed */ - function change_logo_class( $html ) { + function understrap_change_logo_class( $html ) { $html = str_replace( 'class="custom-logo"', 'class="img-fluid"', $html ); $html = str_replace( 'class="custom-logo-link"', 'class="navbar-brand custom-logo-link"', $html ); diff --git a/inc/jetpack.php b/inc/jetpack.php index a2305cc..5415cbf 100644 --- a/inc/jetpack.php +++ b/inc/jetpack.php @@ -13,7 +13,7 @@ * See: https://jetpack.me/support/infinite-scroll/ * See: https://jetpack.me/support/responsive-videos/ */ -function components_jetpack_setup() { +function understrap_components_jetpack_setup() { // Add theme support for Infinite Scroll. add_theme_support( 'infinite-scroll', array( 'container' => 'main', @@ -28,12 +28,12 @@ function components_jetpack_setup() { add_theme_support( 'jetpack-social-menu' ); } -add_action( 'after_setup_theme', 'components_jetpack_setup' ); +add_action( 'after_setup_theme', 'understrap_components_jetpack_setup' ); /** * Custom render function for Infinite Scroll. */ -function components_infinite_scroll_render() { +function understrap_components_infinite_scroll_render() { while ( have_posts() ) { the_post(); if ( is_search() ) : @@ -44,7 +44,7 @@ function components_infinite_scroll_render() { } } -function components_social_menu() { +function understrap_components_social_menu() { if ( ! function_exists( 'jetpack_social_menu' ) ) { return; } else { diff --git a/inc/security.php b/inc/security.php deleted file mode 100644 index 77606c7..0000000 --- a/inc/security.php +++ /dev/null @@ -1,44 +0,0 @@ -ERROR: Stop guessing!'; - } -} // endif function_exists( 'show_less_login_info' ). - -add_filter( 'login_errors', 'show_less_login_info' ); diff --git a/inc/setup.php b/inc/setup.php index 9292fca..8b64ee0 100644 --- a/inc/setup.php +++ b/inc/setup.php @@ -94,7 +94,7 @@ if ( ! function_exists( 'understrap_setup' ) ) : endif; // understrap_setup. add_action( 'after_setup_theme', 'understrap_setup' ); -if ( ! function_exists( 'custom_excerpt_more' ) ) { +if ( ! function_exists( 'understrap_custom_excerpt_more' ) ) { /** * Removes the ... from the excerpt read more link * @@ -102,13 +102,13 @@ if ( ! function_exists( 'custom_excerpt_more' ) ) { * * @return string */ - function custom_excerpt_more( $more ) { + function understrap_custom_excerpt_more( $more ) { return ''; } } -add_filter( 'excerpt_more', 'custom_excerpt_more' ); +add_filter( 'excerpt_more', 'understrap_custom_excerpt_more' ); -if ( ! function_exists( 'all_excerpts_get_more_link' ) ) { +if ( ! function_exists( 'understrap_all_excerpts_get_more_link' ) ) { /** * Adds a custom read more link to all excerpts, manually or automatically generated * @@ -116,10 +116,10 @@ if ( ! function_exists( 'all_excerpts_get_more_link' ) ) { * * @return string */ - function all_excerpts_get_more_link( $post_excerpt ) { + function understrap_all_excerpts_get_more_link( $post_excerpt ) { return $post_excerpt . ' [...]

' . __( 'Read More...', 'understrap' ) . '

'; } } -add_filter( 'wp_trim_excerpt', 'all_excerpts_get_more_link' ); +add_filter( 'wp_trim_excerpt', 'understrap_all_excerpts_get_more_link' ); diff --git a/inc/theme-settings.php b/inc/theme-settings.php index 16cf7db..c7ab6e0 100644 --- a/inc/theme-settings.php +++ b/inc/theme-settings.php @@ -6,8 +6,8 @@ * */ -if ( ! function_exists( 'setup_theme_default_settings' ) ) : - function setup_theme_default_settings() { +if ( ! function_exists( 'understrap_setup_theme_default_settings' ) ) : + function understrap_setup_theme_default_settings() { // check if settings are set, if not set defaults. // Caution: DO NOT check existence using === always check with == . diff --git a/inc/widgets.php b/inc/widgets.php index ecf8396..fff5236 100644 --- a/inc/widgets.php +++ b/inc/widgets.php @@ -9,8 +9,8 @@ * Count number of widgets in a sidebar * Used to add classes to widget areas so widgets can be displayed one, two, three or four per row */ -if ( ! function_exists( 'slbd_count_widgets' ) ) { - function slbd_count_widgets( $sidebar_id ) { +if ( ! function_exists( 'understrap_slbd_count_widgets' ) ) { + function understrap_slbd_count_widgets( $sidebar_id ) { // If loading from front page, consult $_wp_sidebars_widgets rather than options // to see if wp_convert_widget_settings() has made manipulations in memory. global $_wp_sidebars_widgets; diff --git a/inc/woocommerce.php b/inc/woocommerce.php index 157fcf4..a237057 100644 --- a/inc/woocommerce.php +++ b/inc/woocommerce.php @@ -4,12 +4,12 @@ * * @package understrap */ -add_action( 'after_setup_theme', 'woocommerce_support' ); -if ( ! function_exists( 'woocommerce_support' ) ) { +add_action( 'after_setup_theme', 'understrap_woocommerce_support' ); +if ( ! function_exists( 'understrap_woocommerce_support' ) ) { /** * Declares WooCommerce theme support. */ - function woocommerce_support() { + function understrap_woocommerce_support() { add_theme_support( 'woocommerce' ); // Add New Woocommerce 3.0.0 Product Gallery support