Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    Hi @generosus,

    This error is coming from one of your snippets, not from the Code Snippets plugin.

    You should be able to identify which one with a search for str_replace @line:3. Once you have, feel free to post it here for help fixing it up.

    Thread Starter generosus

    (@generosus)

    Hi @bungeshea,

    Thank you so much. Found it. See below. Got fix?

    The code snippet replaces the infamous WP Admin Bar greeting “Howdy, … ” with “Welcome, …” No issues with it, except the warning noted above.

    Cheers!

    —————–

    function replace_howdy( $wp_admin_bar ) {
    $my_account = $wp_admin_bar->get_node( 'my-account' );
    $greeting = str_replace( 'Howdy,', 'Welcome,', $my_account->title );
    $wp_admin_bar->add_node( array(
    'id' => 'my-account',
    'title' => $greeting,
    ) );
    }
    add_filter( 'admin_bar_menu', 'replace_howdy', 25 );
    Thread Starter generosus

    (@generosus)

    Update:

    Fixed! We’re using the one below instead (reference).

    On another note, during our Query Monitor check, we ran into this redirect (red flag). Do you know what this is all about?

    Thank you!

    function wpcode_snippet_replace_howdy( $wp_admin_bar ) {
    // Edit the line below to set what you want the admin bar to display intead of "Howdy,".
    $new_howdy = 'Welcome,';
    $my_account = $wp_admin_bar->get_node( 'my-account' );
    if ( ! isset( $my_account->title ) ) {
    return;
    }
    $wp_admin_bar->add_node(
    array(
    'id' => 'my-account',
    'title' => str_replace( 'Howdy,', $new_howdy, $my_account->title ),
    )
    );
    }
    add_filter( 'admin_bar_menu', 'wpcode_snippet_replace_howdy', 9999 );

    Thread Starter generosus

    (@generosus)

    Update:

    On another note, during our Query Monitor check, we ran into this redirect (red flag). Do you know what this is all about?

    Disregard above question. Issue fixed.

    Cheers!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘PHP Warning and Deprecation Messages Caused by Plugin’ is closed to new replies.