-
-
Save imath/8afc70a43318d306c711 to your computer and use it in GitHub Desktop.
Override template notices
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
<?php | |
function slaffik_render_message() { | |
// Get BuddyPress | |
$bp = buddypress(); | |
if ( ! empty( $bp->template_message ) ) : | |
$type = ( 'success' === $bp->template_message_type ) ? 'updated' : 'error'; | |
$content = apply_filters( 'bp_core_render_message_content', $bp->template_message, $type ); ?> | |
<div id="message" class="slaffik-notice <?php echo esc_attr( $type ); ?>"> | |
<?php echo $content; ?> | |
</div> | |
<?php | |
do_action( 'bp_core_render_message' ); | |
endif; | |
} | |
function slaffik_remove_bp_core_render_message() { | |
remove_action( 'template_notices', 'bp_core_render_message' ); | |
add_action( 'template_notices', 'slaffik_render_message' ); | |
} | |
add_action( 'bp_actions', 'slaffik_remove_bp_core_render_message', 6 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment