Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am really confused at this point. I can not figure it out how to rename Edit My Profile link in the admin backend.

How can that be done?

share|improve this question

2 Answers 2

You could use the wp_before_admin_bar_render hook. You can play with code samples on the Codex page by putting them in your theme's functions.php.

First off you can try examining the object by outputting its contents with print_r(), and you'll see all the familiar items. I would probably use remove_menu helper and then add a new one with the modified link title, just to keep things clean.

add_action( 'wp_before_admin_bar_render', 'my_tweaked_admin_bar' ); 

function my_tweaked_admin_bar() {
    global $wp_admin_bar;

    $wp_admin_bar->remove_menu('edit-profile');

    $wp_admin_bar->add_menu( array(
            'id'    => 'edit-profile',
            'title' => 'Edit Zee Profile',
            'href'  => admin_url('profile.php'),
            'parent'=>'user-actions'
        ));
}

The downside of this approach is that the new item will not show up in the same spot.

share|improve this answer

If you want to alter strings from core code in the backend, a nifty way to get at 'em is by means of the gettext filter.

This filter is applied by every internationalization function, i.e. for every translatable string.

Even if your goal is renaming rather than translating, it does the trick:

function wpse94377_change_admin_ui_text( $translation, $text ) {
    if( is_admin() && 'Edit My Profile' === $text ) {
        return 'Edit My Userdata';
    }
    return $translation;
}
add_filter( 'gettext', wpse94377_change_admin_ui_text, 10, 2 );

Obviously you can also return another translatable string by using
__( 'Edit My Userdata', 'your-text-domain' ) after the first return statement.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.