Created
November 5, 2019 22:55
-
-
Save josephdickson/f085ffb926c9ea9a9ff9e804594383eb to your computer and use it in GitHub Desktop.
WP dashboard notification sample for functions.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Place admin message about the Carousel Video and Carousel categories | |
function pz_carousel_admin_notice() { | |
if ( is_admin() ) { | |
if ( in_category('Carousel Video') ) { | |
$class = 'video-carousel-notice notice notice-info is-dismissible'; | |
$message = __( 'Video Carousel posts are ordered by most recently updated to least. They display on the homepage', 'sample-text-domain' ); | |
printf( '<div class="%1$s"><p>%2$s</p></div>', esc_attr( $class ), esc_html( $message ) ); | |
} | |
if ( in_category('Carousel') ) { | |
$class = 'slide-carousel-notice notice notice-info is-dismissible'; | |
$message = __( 'Carousel posts are ordered by most recently updated to least. They display on the homepage', 'sample-text-domain' ); | |
printf( '<div class="%1$s"><p>%2$s</p></div>', esc_attr( $class ), esc_html( $message ) ); | |
} | |
} | |
} | |
add_action( 'admin_notices', 'pz_carousel_admin_notice' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment