Skip to:
Content
Pages
Categories
Search
Top
Bottom

groups_member_before_save messages not showwing up


  • paragbhagwat
    Participant

    @paragbhagwat

    As mentioned in my other post i am using this hook to do some checking if comments have been entered or not but any bp_core_add_message i put in here are not showing up. It does correctly stop the request and redirects to home page but i am unable to throw an error message.. any idea what is going on??

    Here’s my code..
    `
    add_action( ‘groups_member_before_save’, ‘RECN_PRIVATE_GROUP_REQUEST_VALIDATION’ );

    function RECN_PRIVATE_GROUP_REQUEST_VALIDATION($groupmemberdetails)
    {

    /*
    * only if current slug is request-membership do validation
    */

    bp_core_add_message(‘ hmm the cyrrent action is !!!!’);
    $groupmemberdetails->user_id =”;

    }

Viewing 2 replies - 1 through 2 (of 2 total)

  • Henry Wright
    Moderator

    @henrywright

    The groups_member_before_save hook doesn’t really give you the opportunity to exit execution gracefully if your member doesn’t validate. Is there another hook that you can use?

    I suppose you could force execution to stop by adding a redirect after bp_core_add_message() but that feels slightly hackish:

    bp_core_add_message( $message, 'error' );
    bp_core_redirect( bp_get_groups_directory_permalink() );

    paragbhagwat
    Participant

    @paragbhagwat

    Thanks @Henry. I could not find any other way so was thinking of using this method. Is there a suggested approach for this?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘groups_member_before_save messages not showwing up’ is closed to new replies.
Skip to toolbar