The list_plugin_updates() WordPress PHP function displays the upgrade plugins form.
Usage
To use the list_plugin_updates() function, simply call the function like this:
list_plugin_updates();
Parameters
This function does not have any parameters.
More information
See WordPress Developer Resources: list_plugin_updates
Examples
Display the plugin updates form in a custom admin page
Create a custom admin page to display the plugin updates form:
function my_custom_plugin_updates_page() {
add_menu_page(
'Plugin Updates',
'Plugin Updates',
'manage_options',
'my-plugin-updates',
'my_plugin_updates_callback'
);
}
add_action('admin_menu', 'my_custom_plugin_updates_page');
function my_plugin_updates_callback() {
echo '<div class="wrap">';
echo '<h1>Plugin Updates</h1>';
// Display the plugin updates form
list_plugin_updates();
echo '</div>';
}
Display plugin updates on a custom settings page
Add a new section to your custom settings page for plugin updates:
function my_custom_settings_page() {
add_options_page(
'My Custom Settings',
'My Custom Settings',
'manage_options',
'my-custom-settings',
'my_custom_settings_callback'
);
}
add_action('admin_menu', 'my_custom_settings_page');
function my_custom_settings_callback() {
echo '<div class="wrap">';
echo '<h1>My Custom Settings</h1>';
// Display the plugin updates form
echo '<h2>Plugin Updates</h2>';
list_plugin_updates();
echo '</div>';
}
Display plugin updates in a custom dashboard widget
Create a custom dashboard widget to display the plugin updates form:
function my_custom_dashboard_widget() {
wp_add_dashboard_widget(
'my_plugin_updates_widget',
'Plugin Updates',
'my_plugin_updates_widget_callback'
);
}
add_action('wp_dashboard_setup', 'my_custom_dashboard_widget');
function my_plugin_updates_widget_callback() {
// Display the plugin updates form
list_plugin_updates();
}
Display plugin updates in a custom meta box
Create a custom meta box on the post edit screen to display the plugin updates form:
function my_custom_meta_box() {
add_meta_box(
'my_plugin_updates_meta_box',
'Plugin Updates',
'my_plugin_updates_meta_box_callback',
'post'
);
}
add_action('add_meta_boxes', 'my_custom_meta_box');
function my_plugin_updates_meta_box_callback() {
// Display the plugin updates form
list_plugin_updates();
}
Display plugin updates in a custom admin notice
Create a custom admin notice to display the plugin updates form:
function my_custom_admin_notice() {
$screen = get_current_screen();
if ($screen->id == 'dashboard') {
echo '<div class="notice notice-info">';
echo '<h3>Plugin Updates</h3>';
// Display the plugin updates form
list_plugin_updates();
echo '</div>';
}
}
add_action('admin_notices', 'my_custom_admin_notice');