dashboard - change the words "Wordpress running on theme" in "At a glance",especially the li

admin2025-06-02  4

l just wanna change words "wordpress x.x.x running on theme"in "At a glance",actually l wanna remove the link "theme.php".l added the code in my function.php:

    add_filter('gettext', 'remove_admin_stuff', 20, 3);

function remove_admin_stuff( $translated_text, $untranslated_text, $domain ) {

    $custom_field_text = 'You are using <span class="b">WordPress %s</span>.';

    if ( is_admin() && $untranslated_text === $custom_field_text ) {
        return '';
    }

    return $translated_text;
}

wanna make a trick.but it failed .please help me.

l just wanna change words "wordpress x.x.x running on theme"in "At a glance",actually l wanna remove the link "theme.php".l added the code in my function.php:

    add_filter('gettext', 'remove_admin_stuff', 20, 3);

function remove_admin_stuff( $translated_text, $untranslated_text, $domain ) {

    $custom_field_text = 'You are using <span class="b">WordPress %s</span>.';

    if ( is_admin() && $untranslated_text === $custom_field_text ) {
        return '';
    }

    return $translated_text;
}

wanna make a trick.but it failed .please help me.

Share Improve this question asked Mar 15, 2019 at 9:53 Leon ZhaoLeon Zhao 11 bronze badge 1
  • 1 Your function returns empty string or $translated_text which was not modified. – Max Yudin Commented Mar 15, 2019 at 10:18
Add a comment  | 

1 Answer 1

Reset to default 0

This code may help you.

function wpfi_change_text( $translated_text ) {
        if ( $translated_text == 'ORIGINAL TEXT' ) {
            $translated_text = '';
        }
        return $translated_text;
    }
    add_filter( 'gettext', 'wpfi_change_text', 20 );
转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748803968a313855.html

最新回复(0)