Skip to content

Instantly share code, notes, and snippets.

@solepixel
Last active December 25, 2015 15:49
Show Gist options
  • Save solepixel/7001497 to your computer and use it in GitHub Desktop.
Save solepixel/7001497 to your computer and use it in GitHub Desktop.
Sample Usage of cgc_notices
<?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