Adds a column to the Plugins page where you can add, edit, or delete notes about a plugin.
Have you ever returned to a site that you built a while back and asked, “Why did I install this plugin?” This plugin provides an extra column on the Plugins page that enables you to add, edit, or delete notes about the plugins you have installed on a particular site. These notes are intended to provide documentation regarding why a particular plugin was installed and how or where it’s being used.
Can I display the plugin notes beneath the plugin description instead of in a separate column?
As of version 1.2.4, you can use the filter plugin-notes-plus_note_placement to move notes beneath the plugin description.
Here is an example of a snippet that places plugin notes beneath the plugin description. It can be added to your child theme’s functions.php. Without this, the note position will default to a separate column on the plugins page.
function pnp_change_note_placement( $note_placement ) {
$note_placement = 'description';
return $note_placement;
}
add_filter( 'plugin-notes-plus_note_placement', 'pnp_change_note_placement' );
Can I modify which icons are available to display next to plugin notes?
Yes, you can use the filter plugin-notes-plus_icon_options to modify the set of icons available. The icons must be selected from the list of available WordPress dashicons.
Here is an example of a snippet that removes one icon and adds an additional icon to the list of options. It can be added to your child theme’s functions.php:
function pnp_change_icon_options( $icon_options ) {
// Remove key option
unset( $icon_options['dashicons-admin-network'] );
// Add smartphone option
$icon_options['dashicons-smartphone'] = 'Smartphone';
return $icon_options;
}
add_filter( 'plugin-notes-plus_icon_options', 'pnp_change_icon_options' );
Which HTML tags are permitted, and can that list be modified?
You can use the following HTML tags: a, br, p, b, strong, i, em, u, hr.
To modify the list of available tags, use the filter plugin-notes-plus_allowed_html. Be careful, however, to avoid allowing tags that could leave the site vulnerable to an XSS attack.
function pnp_change_allowed_html_tags( $allowed_tags ) {
// Remove br from allowed tags
unset( $allowed_tags['br'] );
// Add img to allowed tags
$allowed_tags['img'] = array();
return $allowed_tags;
}
add_filter( 'plugin-notes-plus_allowed_html', 'pnp_change_allowed_html_tags' );
Where is the data stored?
Plugin notes and note metadata are stored in a custom table whose name ends in plugin_notes_plus. In the initial version (1.0.0), notes were stored in the options table. Version 1.1.0 was released to migrate existing notes from the options table into the plugin_notes_plus table. Upgrading to version 1.1.1 will perform a cleanup, removing any notes from the options table.
How does it work on multisite installs?
Each site within a multisite install maintains its own plugin notes. Additionally, the superadmin can maintain their own plugin notes.
Can I hide plugin notes from specific users?
As of version 1.2.6, you can use the filter plugin-notes-plus_hide_notes to show or hide plugin notes.
Here is an example of a snippet that hides plugin notes from a specfic user. It can be added to your child theme’s functions.php. Without this, plugin notes are displayed by default to all users who can view the plugins page.
function pnp_hide_notes( $hide_notes ) {
// logic to set $hide_notes to TRUE or FALSE
return $hide_notes;
}
add_filter( 'plugin-notes-plus_hide_notes', 'pnp_hide_notes' );