• Hi,

    I want to have a flag in stead of my avatar (which I don’t have anyway) next to my profile in the toolbar of my website.

    So I figured out that there is a filter in wp-includes/pluggable.php 2214:
    “return apply_filters( ‘get_avatar’, $avatar, $id_or_email, $args[‘size’], $args[‘default’], $args[‘alt’], $args );”

    So in my tweak file I’ve added:

    function get_flag ( ) {
    global $language;
    $flag_name = ‘../../wp-content/uploads/’.$language.’.png’;
    $flag_html = “<img src = ‘”.$flag_name.”‘ alt = ‘”.$language.”‘>”;
    return $flag_html;
    }

    add_filter ( ‘pre_get_avatar’, ‘get_flag’ ); //used in wp-includes/admin-bar.php line 182 ; filter in wp-includes/pluggable.php 2214

    But, using the line “”echo “
    PCB>” . __FILE__ . ” – ” . __LINE__;” just before and after the add-filter line, I see that that line stops the execution.
    Why?
    I’ve replaced the add_filter line with a copy of an add_filter line somewhere else in the pack, but got the same problem.
    Anyone can explain what I do wrong?
    Thanks

    Christiaan Boland

Viewing 1 replies (of 1 total)
  • Thread Starter ChristiaanBoland

    (@christiaanboland)

    O, by the way, hard programming the function in the file wp-includes/pluggable.php it works as expected, but not using the filter: I simply replaced the assignment;
    $avatar = get_flag(); /* P.C. Boland 2015-07-29; was: get_avatar( $user_id, 26 );*/

    and copied the function in wp-includes/pluggable.php

    Christiaan Boland

Viewing 1 replies (of 1 total)
  • The topic ‘Can't get passed my first ass_filter implementation’ is closed to new replies.