BuddyDev

Search

[Resolved] How to remove function noftifications

  • Participant
    Level: Initiated
    Posts: 17
    maimaimemain on #20686

    Hi there,

    I entered an array of notification contents in “user_meta” and created a notification function.

    So I want to delete the default notification function.

    I would like to remove “#wp-admin-bar-bp-notifications”, what kind of method is there?

    Thank you in advance for your help.

  • Keymaster
    (BuddyDev Team)
    Posts: 24212
    Brajesh Singh on #20689

    Hi maimaimemain,

    Thank you for asking.
    You may use the following code

    
    
    /**
     * Remove notifications node from adminbar.
     */
    function buddydev_custom_remove_notifications_menu() {
    	global $wp_admin_bar;
    	if ( ! is_admin_bar_showing() ) {
    		return;
    	}
    	$wp_admin_bar->remove_node( 'bp-notifications' );
    }
    
    add_action( 'wp_before_admin_bar_render', 'buddydev_custom_remove_notifications_menu' );
    

    That should do it.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 17
    maimaimemain on #20701

    Hi Brajesh,

    Thank your for your reply.

    I ditd it!
    Because of you!!
    All because of you!!!

    I appreciate your continued support.

    Regards
    maimaimemain

  • Keymaster
    (BuddyDev Team)
    Posts: 24212
    Brajesh Singh on #20708

    Hi maimaimemain,
    Thank you for the kind words. I am glad I was able to assist you.

    Best regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: resolved