Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How rename a plugin title > Wordpress > Dashboard

Tags:

wordpress

Please, may someone help me? I need change the name of a plugin installed in my wordpress (Only the name in the admin bar is fine ;) . Thanks!

Preview:

enter image description here

like image 941
Erick Amoedo Avatar asked Dec 02 '15 17:12

Erick Amoedo


People also ask

How do I name a WordPress plugin?

Navigate to the WordPress installation's wp-content directory. Open the plugins directory. Create a new directory and name it after the plugin (e.g. plugin-name ). Open the new plugin's directory.

How do I Rename a WordPress plugin folder?

Inside the wp-content folder, you will see a folder called plugins. This is where WordPress stores all plugins installed on your website. You need to right-click on the plugins folder and select Rename. Next, change the name of the plugins folder to anything that you like.


1 Answers

Here's the process to change the labels (I changed WooCommerce to "Stall" in my example). You could try that with the gettext filter in the following manner.

Use this in your functions.php file

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

$strings = array(
    'WooCommerce' => 'Stall',
    'Custom Header' => 'Custom Stall'
);

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 );

Also you can apply below code

function my_text_strings( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
    case 'WooCommerce' :
        $translated_text = __( 'Stall', 'woocommerce' );
        break;
}
return $translated_text;
}
add_filter( 'gettext', 'my_text_strings', 20, 3 );

enter image description here

like image 158
Lemon Kazi Avatar answered Oct 28 '22 19:10

Lemon Kazi