On this page
WP_Plugins_List_Table::no_items()
Source
File: wp-admin/includes/class-wp-plugins-list-table.php. View all references
public function no_items() {
global $plugins;
if ( ! empty( $_REQUEST['s'] ) ) {
$s = esc_html( wp_unslash( $_REQUEST['s'] ) );
/* translators: %s: Plugin search term. */
printf( __( 'No plugins found for: %s.' ), '<strong>' . $s . '</strong>' );
// We assume that somebody who can install plugins in multisite is experienced enough to not need this helper link.
if ( ! is_multisite() && current_user_can( 'install_plugins' ) ) {
echo ' <a href="' . esc_url( admin_url( 'plugin-install.php?tab=search&s=' . urlencode( $s ) ) ) . '">' . __( 'Search for plugins in the WordPress Plugin Directory.' ) . '</a>';
}
} elseif ( ! empty( $plugins['all'] ) ) {
_e( 'No plugins found.' );
} else {
_e( 'No plugins are currently available.' );
}
}
Related
Uses
| Uses | Description |
|---|---|
| current_user_can() wp-includes/capabilities.php | Returns whether the current user has the specified capability. |
| __() wp-includes/l10n.php | Retrieves the translation of $text. |
| _e() wp-includes/l10n.php | Displays translated text. |
| wp_unslash() wp-includes/formatting.php | Removes slashes from a string or recursively removes slashes from strings within an array. |
| esc_html() wp-includes/formatting.php | Escaping for HTML blocks. |
| esc_url() wp-includes/formatting.php | Checks and cleans a URL. |
| is_multisite() wp-includes/load.php | If Multisite is enabled. |
| admin_url() wp-includes/link-template.php | Retrieves the URL to the admin area for the current site. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_plugins_list_table/no_items