Update prefixes

This commit is contained in:
koenemann 2017-11-27 09:07:11 +01:00
parent 4c5c07baa1
commit 464086a40b
7 changed files with 23 additions and 67 deletions

View File

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

View File

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

View File

@ -1,44 +0,0 @@
<?php
/**
* Inspired by Simon Bradburys cleanup.php fromb4st theme https://github.com/SimonPadbury/b4st
*
* @package understrap
*/
if ( ! function_exists( 'no_generator' ) ) {
/**
* Removes the generator tag with WP version numbers. Hackers will use this to find weak and old WP installs
*
* @return string
*/
function no_generator() {
return '';
}
} // endif function_exists( 'no_generator' ).
add_filter( 'the_generator', 'no_generator' );
/*
Clean up wp_head() from unused or unsecure stuff
*/
remove_action( 'wp_head', 'wp_generator' );
remove_action( 'wp_head', 'rsd_link' );
remove_action( 'wp_head', 'wlwmanifest_link' );
remove_action( 'wp_head', 'index_rel_link' );
remove_action( 'wp_head', 'feed_links', 2 );
remove_action( 'wp_head', 'feed_links_extra', 3 );
remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10);
remove_action( 'wp_head', 'wp_shortlink_wp_head', 10);
if ( ! function_exists( 'show_less_login_info' ) ) {
/**
* Show less info to users on failed login for security.
* (Will not let a valid username be known.)
*
* @return string
*/
function show_less_login_info() {
return '<strong>ERROR</strong>: Stop guessing!';
}
} // endif function_exists( 'show_less_login_info' ).
add_filter( 'login_errors', 'show_less_login_info' );

View File

@ -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 . ' [...]<p><a class="btn btn-secondary understrap-read-more-link" href="' . get_permalink( get_the_ID() ) . '">' . __( 'Read More...',
'understrap' ) . '</a></p>';
}
}
add_filter( 'wp_trim_excerpt', 'all_excerpts_get_more_link' );
add_filter( 'wp_trim_excerpt', 'understrap_all_excerpts_get_more_link' );

View File

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

View File

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

View File

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