Before Display Info
do_action( 'vikupdater_before_display_plugin_info', object $info, object $manifest, array $options )
Action used to manipulate the plugin info before displaying them.
Description
The plugin information are taken whenever an administrator clicks on the "View Details" button of a plugin. This action will open a sort of modal that loads remote contents from the URL specified during the subscription of the plugin.
Any changes applied to the $info
argument will be automatically reflected into the layout used by WordPress to display the information of the selected plugin.
Parameters
- $info
-
(object) The object holding the plugin details, compatible with the WordPress requirements.
- $manifest
-
(object) The plugin manifest (JSON-decoded) fetched through the API call made on the plugin "check" URL.
- $options
-
(array) A configuration array, taken from the associative array specified during the subscription of the plugin.
Example
The example below explains how to add a custom tab to the details view of a plugin.
function your_plugin_vikupdater_before_display_info( $info, $manifest, $options ) {
// make sure we are observing our plugin
if ( 'your-plugin' !== $info->slug ) {
return;
}
// register the "License" tab
$info->sections[ __('License', 'your-plugin') ] = '<p>' . __('The license information goes here...', 'your-plugin') . '</p>';
}
add_action( 'vikupdater_before_display_plugin_info', 'your_plugin_vikupdater_before_display_info', 10, 3 );
Changelog
Version | Description |
---|---|
2.0 | Introduced. |