diff options
| author | Max | 2018-10-15 23:46:42 +0200 |
|---|---|---|
| committer | Max | 2018-10-15 23:46:42 +0200 |
| commit | 00c9709fd9763542e848f6278db8ba26af5c9886 (patch) | |
| tree | 92cb1c1ee4c467118e1e5a4c7e233d3feac6efa8 /inc/hooks.php | |
| download | fuselkoenig_de-00c9709fd9763542e848f6278db8ba26af5c9886.tar.gz | |
Initial commit.
Diffstat (limited to 'inc/hooks.php')
| -rw-r--r-- | inc/hooks.php | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/inc/hooks.php b/inc/hooks.php new file mode 100644 index 0000000..8cd0b8d --- /dev/null +++ b/inc/hooks.php @@ -0,0 +1,49 @@ +<?php +/** + * Custom hooks. + * + * @package understrap + */ + +if ( ! defined( 'ABSPATH' ) ) { + exit; // Exit if accessed directly. +} + +if ( ! function_exists( 'understrap_site_info' ) ) { + /** + * Add site info hook to WP hook library. + */ + function understrap_site_info() { + #do_action( 'understrap_site_info' ); + } +} + +if ( ! function_exists( 'understrap_add_site_info' ) ) { + add_action( 'understrap_site_info', 'understrap_add_site_info' ); + + /** + * Add site info content. + */ + function understrap_add_site_info() { + $the_theme = wp_get_theme(); + + $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:*/ + esc_html__( 'Proudly powered by %s', 'understrap' ), 'WordPress' + ), + sprintf( // WPCS: XSS ok. + /* translators:*/ + 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:*/ + esc_html__( 'Version: %1$s', 'understrap' ), $the_theme->get( 'Version' ) + ) + ); + + echo apply_filters( 'understrap_site_info_content', $site_info ); // WPCS: XSS ok. + } +} |
