Skip to:
Content
Pages
Categories
Search
Top
Bottom

SOLVED: Filtering display/nice name everywhere


  • Gary Cornelisse
    Participant

    @gcornelisse

    Maybe this is a more basic WP question, but I’ve looked and can’t find a clear answer. I’m trying to filter the name of a member everywhere its shown in BP. It looks like apply_filters is setting addition variables, but I get an warnings about missing arguements…

    Line 187 in bp-xprofile-functions.php
    $data = apply_filters( 'xprofile_get_field_data', $values, $field_id, $user_id );

    My custom filter…

    function my_name_filter($values, $field_id, $user_id)
    {
    	//just testing to see what I get or don't get
    	echo ("$values - $arg2 - $arg3");
    
    	return $values;
    }
    
    add_filter('xprofile_get_field_data', 'my_name_filter');
Viewing 2 replies - 1 through 2 (of 2 total)

  • Gary Cornelisse
    Participant

    @gcornelisse

    Just to add… I get data in $values, but $field_id and $user_id are empty. How do I access the $field_id and $user_id that apply_filters is obviously sending somewhere?


    Gary Cornelisse
    Participant

    @gcornelisse

    add_filter takes four parameters… the 4th parameter is how many arguments to pass. I didn’t have it set so it assumed 1.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘SOLVED: Filtering display/nice name everywhere’ is closed to new replies.
Skip to toolbar