WP_Plugins_List_Table::no_items() WordPress Method

The WP_Plugins_List_Table::no_items() function is used to display a message when there are no plugins installed or no plugins active.

WP_Plugins_List_Table::no_items() #


Source

File: wp-admin/includes/class-wp-plugins-list-table.php

	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.' );
		}
	}

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.