0

I'm trying to change on the backend from:

Appearance -> Header

To

Appearance -> Logo

But the Changing Admin Menu Labels answer didn't help so far.

Any new tip?

Thanks

2 Answers 2

1

You could try that with the gettext filter in the following manner.

function rename_header_to_logo( $translated, $original, $domain ) {

    $strings = array(
        'Header' => 'Logo',
        'Custom Header' => 'Custom Logo',
        'You can upload a custom header image to be shown at the top of your site instead of the default one. On the next screen you will be able to crop the image.' => 'You can upload a custom logo to be shown at the top of your site instead of the default one. On the next screen you will be able to crop the image.'
    );

    if ( isset( $strings[$original] ) && is_admin() ) {
        $translations = &get_translations_for_domain( $domain );
        $translated = $translations->translate( $strings[$original] );
    }

    return $translated;
}

add_filter( 'gettext', 'rename_header_to_logo', 10, 3 );

You might want to check that the text doesn't conflict with another "header" text somewhere else.

1
  • Indeed it conflicts with others "header" text. Unfortunately, gettext is not the way to go.
    – Daniel
    Commented Mar 24, 2012 at 13:54
0

When no hook is available, jQuery it...

add_action( 'admin_footer', 'wpse_46677_change_menu_item' );

function wpse_46677_change_menu_item()
{
    ?>
        <script type="text/javascript">
            jQuery(document).ready( function($) {
                $("#menu-appearance").find("li:contains('Header')").html('<a href="themes.php?page=custom-header">My Text</a');
            });     
        </script>
    <?php
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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