Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

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

  • had_hc
    Participant

    @had_hc

    After diving more into the filters mentioned by shanebp, I managed to manipulate the notification message. For those interested, I just add bp_core_add_message( $message, $type ); function into the form process function with $message as the message when updated and $type as ‘success’ to give it a green color success notification.

    However, I’m most probably gonna move those fields to their own tab anyway.


    had_hc
    Participant

    @had_hc

    Ah, I guess i should open up a new tab then to solve the notification issue. Thanks for the help anyway.


    had_hc
    Participant

    @had_hc

    So, after more reading, I’ve managed to solved this (90% solved I would say) by changing the line if ( wp_verify_nonce( $_POST['bp_settings_general'] ) ) that i wrote in the first post to if ( isset($_POST['submit']) && check_admin_referer('bp_settings_general') ). And now my field is saved!

    I would like to say sorry for not studying enough about using wp_verify_nonce() in processing form.

    However, there still a bit of an issue left. I still got ‘No changes were made to your account.’ notification warning in a red box under the cover banner image even though my input is saved. Would anybody point me to what function or hook to use to tell the notification that something has been saved? Thanks!


    had_hc
    Participant

    @had_hc

    Hi shanebpb, what ure referring to is the edit profile tab under the Profile nav menu. What i’m trying to do is add custom field to the General tab under the Settings nav menu. The template I’m talking about is at /buddypress/members/single/settings/ folder of the template folder. Sorry if i wasn’t being clear enough before this.
    That said, having the field displayed is not the issue I’m having, saving th custom field is my issue here. The nonce i was talking about is there in the general.php file and it’s within the <form></form> section, so i figure it can be used somehow to save the field.
    I’ll try what coffeywebdev suggested by using different action hook instead of the ‘init’ hook I’m using now.


    had_hc
    Participant

    @had_hc

    Great! It worked! Thanks for that!


    had_hc
    Participant

    @had_hc

    After some googling, I found the answer from here! The action ‘bp_core_setup_globals’ is the answer and it works well!

Viewing 6 replies - 1 through 6 (of 6 total)
Skip to toolbar