Skip to:
Content
Pages
Categories
Search
Top
Bottom

Modificar el author link en la página de actividad


  • soportemenntun
    Participant

    @soportemenntun

    Hello community,
    I have created an additional field in the activity form with the following code:

    add_action ('bp_after_activity_post_form', 'ibdnet_publicar_anonimo'); 
    function ibdnet_publicate_anonymous () { 
    $ html = '<div class = "checkbox ibdnet-chek-anonymous"> 
    <label> 
    <input type = "checkbox" name = "ibdnet-chek-anonymous" id = "ibdnet-chek-anonymous" > 
    Publish anonymous 
    </ label> 
    </ div> ';
    
    echo $ html; 
    }

    and I’m saving the id of the activity in the usermeta table with the following code:

    add_action ('bp_activity_posted_update', 'add_anonymous_to_activity', 10, 3); 
    function add_anonymous_to_activity ($ content, $ user_id, $ activity_id) {
    
    if ($ _POST ['ibdnet-chek-anonymous']): 
    $ anonymous_activity = get_user_meta ($ user_id, 'ibdnet_anonymous_activity'); 
    $ anonymous_activity = empty ($ anonymous_activity)? $ activity_id: $ anonymous_activity. ','. $ activity_id; 
    update_user_meta ($ user_id, 'ibdnet_anonymous_activity', $ anonymous_activity); 
    endif; 
    }

    How can I make the names of the authors appear as anonymous if they select the field that I created as anonymous if they select the option?

    Try with the hook bp_core_get_userlink but it does not work, any idea of ​​how to do it? Thank you.

  • You must be logged in to reply to this topic.
Skip to toolbar