This repository has been archived on 2020-05-08. You can view files and clone it, but cannot push or open issues or pull requests.
understrap/inc/hooks.php

52 lines
1.3 KiB
PHP
Raw Normal View History

2018-08-06 20:19:50 +00:00
<?php
/**
* Custom hooks
2018-08-06 20:19:50 +00:00
*
* @package understrap
*/
2019-06-20 08:57:12 +00:00
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
2018-09-10 21:59:04 +00:00
if ( ! function_exists( 'understrap_site_info' ) ) {
2018-11-18 23:38:50 +00:00
/**
* Add site info hook to WP hook library.
*/
function understrap_site_info() {
do_action( 'understrap_site_info' );
}
2018-08-06 20:19:50 +00:00
}
2019-12-19 22:05:22 +00:00
add_action( 'understrap_site_info', 'understrap_add_site_info' );
2018-08-06 20:19:50 +00:00
if ( ! function_exists( 'understrap_add_site_info' ) ) {
2018-11-18 23:38:50 +00:00
/**
* Add site info content.
*/
function understrap_add_site_info() {
$the_theme = wp_get_theme();
2018-08-06 20:19:50 +00:00
2018-11-18 23:38:50 +00:00
$site_info = sprintf(
'<a href="%1$s">%2$s</a><span class="sep"> | </span>%3$s(%4$s)',
esc_url( __( 'http://wordpress.org/', 'understrap' ) ),
sprintf(
/* translators: WordPress */
2018-11-18 23:38:50 +00:00
esc_html__( 'Proudly powered by %s', 'understrap' ),
'WordPress'
),
sprintf( // WPCS: XSS ok.
/* translators: 1: Theme name, 2: Theme author */
2018-11-18 23:38:50 +00:00
esc_html__( 'Theme: %1$s by %2$s.', 'understrap' ),
$the_theme->get( 'Name' ),
'<a href="' . esc_url( __( 'http://understrap.com', 'understrap' ) ) . '">understrap.com</a>'
),
sprintf( // WPCS: XSS ok.
/* translators: Theme version */
2018-11-18 23:38:50 +00:00
esc_html__( 'Version: %1$s', 'understrap' ),
$the_theme->get( 'Version' )
)
);
echo apply_filters( 'understrap_site_info_content', $site_info ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
2018-11-18 23:38:50 +00:00
}
2018-08-06 20:19:50 +00:00
}