Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

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

  • pokhsujan
    Participant

    @pokhsujan

    Thank You @Henry,
    I did my task using another hook though. I used bp_activity_posted_update hook to accomplish the task.
    Thank you very much for your reply.


    pokhsujan
    Participant

    @pokhsujan

    Thankyou @r-a-y,
    Thanky you very much, You made my day.


    pokhsujan
    Participant

    @pokhsujan

    Anyone ?
    Please Help


    pokhsujan
    Participant

    @pokhsujan

    Sorry if I could’nt illustrate my problem clearly.
    I already have assigned user roles/ types for all users. What I need is to find the submitted value from the buddypress member search that I have added.
    If I could find the submitted value I could solve my problem.
    Currently, I have added an extra field in my buddypress Member search form and when I submit it, I could see the other fields have been submitted through ajax while my new field data is not submitted.
    here is the hook I used to add the new field.
    add_filter( ‘bp_directory_members_search_form’, ‘role_based_filter’, 10, 1 );
    function role_based_filter($search_form_html){
    $query_arg = bp_core_get_component_search_query_arg( ‘members’ );
    // echo ‘query args is’ . $query_arg;

    if ( ! empty( $_REQUEST[ $query_arg ] ) ) {
    $search_value = stripslashes( $_REQUEST[ $query_arg ] );
    } else {
    $search_value = bp_get_search_default_text( ‘members’ );
    }
    // echo ‘submitted is ‘ . $_REQUEST[ $query_arg ];
    $user_content = get_users_content();
    $roles = $user_content[‘roles’];
    $search_form_html = ‘<form action=”” method=”get” id=”search-members-form”>
    <label for=”members_search”><input type=”text” name=”‘ . esc_attr( $query_arg ) . ‘” id=”members_search” placeholder=”‘. esc_attr( $search_value ) .'” /></label><label for=”members-role”><select name=”members_role” id=”members-role”><option value=””> Role </option>’;
    foreach ($roles as $key => $role) {
    $search_form_html .= ‘<option value=”‘.$role.'”>’.$role.'</option>’;
    }
    $search_form_html .= ‘</select></label>
    <input type=”submit” id=”members_search_submit” name=”members_search_submit” value=”‘ . __( ‘Search’, ‘buddypress’ ) . ‘” />
    </form>’;
    return $search_form_html;
    }

    where, get_users_content is my custom function to get all the user’s role and ids.


    pokhsujan
    Participant

    @pokhsujan

    Thanks @danbp,
    I have been able to do what I needed by editing the register page from my child theme and with some jQuery.

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