Extension 2: Custom Name in the Admin Menu

January 16th, 2010 by Tobias Leave a reply »

In my second post of the series on WP-Table Reloaded Extensions, I will show you a way to change the name of the plugin in the WP Admin Menu.

Remember, Extensions are small code snippets that customize or extend the functionality of WP-Table Reloaded, by using the many “Plugin Hooks”. To get started, you should read the introduction on WP-Table Reloaded Extensions and follow the included instructions to set up the foundation. I also recommend reading the first post of this series, where I add an Automatic Converter for URLs to Links. You don’t need the code from there, but it might be helpful to better understand the concept.

In this post, I will show you how to change the name of the plugin in the WP Admin Menu. The default value is “WP-Table Reloaded” which might not be easy to recognize by clients or people using WordPress as a CMS. To better show, what I’m talking about: Here are two screenshots, one before activating the Extension and one after activating it.

Screenshot of the old and new entries in the WP Admin Menu

The menu entry was changed from “WP-Table Reloaded” to “Tables”. (Remember that you can also move that entry to another parent entry with the corresponding admin option in the “Plugin Options” of WP-Table Reloaded.)

And here is the code:

/**
 * Changes the WP Admin Menu entry from "WP-Table Reloaded" to "Tables"
 * @author Tobias Baethge
 * @see https://tobias.baethge.com/2010/01/extension-2-custom-name-in-the-menu/
 */
function wp_table_reloaded_admin_menu_entry( $name ) {
    return 'Tables';
}
add_filter( 'wp_table_reloaded_plugin_display_name', 'wp_table_reloaded_admin_menu_entry' );

This code just needs to be copied into the file “wp-table-reloaded-extensions.php”, which needs to be created according to these instructions (after the Plugin Header comment, but before the closing PHP bracket ?>). Then, just activate the new plugin “WP-Table Reloaded Extensions”. That’s it! :-)

If you like this series of Extensions, I’m happy about any feedback, and especially about further suggestions!

Previous posts in this series that might interest you: