Last active
December 25, 2015 15:49
-
-
Save solepixel/7001497 to your computer and use it in GitHub Desktop.
Sample Usage of cgc_notices
This file contains hidden or 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
<?php | |
function handle_notices(){ | |
$updated = isset( $_GET['whatever-updated'] ) ? $_GET['whatever-updated'] : false; | |
if( $updated !== false ){ | |
$type = $updated ? 'success' : 'error'; | |
$message = $updated ? __( 'Your whatever was updated.', 'cgc' ) : __( 'There was a problem updating whatever.', 'cgc' ); | |
cgc_add_notice( $message, $type ); | |
} | |
} | |
add_action( 'cgc_notices', 'handle_notices' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment