Renaming Nexcess Plugin
complete
K
Kevin M.
We would like the ability to rename the pre-installed Nexcess plugin so clients see our company name instead of Nexcess in the left hand and top navigation in the WordPress admin area.
Brian Watson
complete
J
Jenny R.
Hi Kevin,
As of this morning's release,
1.27.0
, we have added a filter you can use to disable the Nexcess branding in the admin bar entirely. You can add the filter like so: add_filter( 'nexcess_mapps_show_admin_bar', '__return_false' );
The
wp-content/mu-plugins/nexcess-mapps/README.md
has been updated as well. As Steve previously noted, this will need to be added to a mu-plugin that will load before the nexcess-mapps mu-plugin.I hope this helps, please let us know if you have any further questions.
Best,
Jenny
S
Steve G.
Hi Kevin,
I'm one of the developers on the Nexcess MAPPS MU plugin, and I can confirm that there are a number of filters available to help you re-brand the plugin UI. We even go so far as to let you disable particular pages plus change the logo, support URLs, and more!
As Tim mentioned, we've documented them in the
wp-content/mu-plugins/nexcess-mapps/README.md
file. We're also working on ways to better expose that documentation.Thanks for reaching out!
-Steve
K
Kevin M.
Steve G.: Perfect thank you for the advise, just what I needed.
K
Kevin M.
Steve G.: Hi Steve, it appears that the only filters that work are renaming the company name. I am trying to disable the plugin, but the setting gets ignores. I am adding this to the Theme's function file, should it go somewhere else?
S
Steve G.
Kevin M.: Your active theme's
functions.php
file should be a fine place for adding the filters. The calls to add_filter()
should be outside of any sort of callback, as you need them to run as early as possible. For example:<?php
// This may not work as expected:
add_action( 'init', function () {
add_filter( 'nexcess_mapps_show_dashboard', '__return_false' );
} );
// Much better:
add_filter( 'nexcess_mapps_show_dashboard', '__return_false' );
We've recently made a pass through the plugin to find any references to Nexcess that don't use these filters and update them to do so, but we may have missed a few. Could you please share exactly which filters you're trying to use and where in the UI they are seemingly not being applied?
Also, to clarify, when you say you're "trying to disable the plugin", is this in reference to the plugin installer feature (e.g.
add_filter( 'nexcess_mapps_show_plugin_installer', '__return_false' );
), or are you trying to disable the entire Nexcess MAPPS MU plugin?K
Kevin M.
Steve G.: Hi Steve, I am trying to disable the plugin so it is not accessible by our clients. I was using this this:
### Disable the Nexcess MAPPS dashboard
You may hide the "Nexcess" menu item (and any children) with the following filter:
```php
/**
* Disable the Nexcess MAPPS dashboard.
*/
add_filter( 'nexcess_mapps_show_dashboard', '__return_false' );
```
Attached is an image of the functions.php file and the backend of WP.
S
Steve G.
Kevin M.: Digging deeper, the "nexcess_mapps_show_dashboard" filter gets evaluated before themes or regular plugins get processed, so I was incorrect regarding your theme's
functions.php
(at least in that particular case).To disable the "Install Plugins" screen, you'll need to add the filter
before
wp-content/mu-plugins/nexcess-mapps.php
runs, so I'd recommend creating your own MU plugin to contain any Nexcess-specific modifications.Since WordPress loads MU plugins alphabetically, I'd recommend something like
wp-content/mu-plugins/000-nexcess-customizations.php
with the following content:<?php
/**
* Customization for the Nexcess Managed Applications platform.
*
* Full documentation is available in nexcess-mapps/README.md.
*/
/**
* Disable the Nexcess plugin installer.
*/
add_filter( 'nexcess_mapps_show_plugin_installer', '__return_false' );
// Add other filters here...
In your screenshot, you pointed not to the "Install Plugins" screen but rather the "Nexcess" items in the WP Admin menu and admin bar.
If your intention is to hide those menu items in their entirety, you'll want to use the "nexcess_mapps_show_dashboard" filter instead:
/**
* Disable the Nexcess MAPPS dashboard.
*/
add_filter( 'nexcess_mapps_show_dashboard', '__return_false' );
At this time, there isn't a filter to disable the admin bar menu, but it should apply the appropriate branding filters.
I'll get tickets opened internally to clarify the MU plugin loading order in the documentation, as well as adding a filter for the admin bar menu.
K
Kevin M.
Steve G.: Thank you, that worked I was able to disable the menu items on the left and renamed the company name in the top menu which is fine. One last question should the logo filter be changing the logo in the top nav?
S
Steve G.
Kevin M.: Glad to hear it!
The "nexcess_mapps_branding_company_image" filter is used for the full logo in the top-right corner of the Nexcess dashboard pages. For the logo in the admin bar, you're looking for the "nexcess_mapps_branding_company_icon_svg" filter.
T
Tim F.
Hi Kevin, I'm not Nexcess support, but you can do that either by creating a plugin or adding some code to your theme's functions.php file. If you look in the
wp-content/mu-plugins/nexcess-mapps/README.md
file you will see instructions for how to change the name either in individual locations, or site-wide through a template file. You can also override the icon in a similar manner./**
* Override the company name used throughout the Nexcess MAPPS platform.
*
* @param string $name The branded company name.
*/
add_filter( 'nexcess_mapps_branding_company_name', function ( $name ) {
return 'Awesome Agency Co.';
} );
K
Kevin M.
Tim F.: Thank you Tim, I am going to give it a try.