WP_Plugins_List_Table::_search_callbackpublicWP 3.1.0

Callback to filter plugins by a search term.

Method of the class: WP_Plugins_List_Table{}

No Hooks.

Returns

bool. True if the plugin matches the search term, false otherwise.

Usage

$WP_Plugins_List_Table = new WP_Plugins_List_Table();
$WP_Plugins_List_Table->_search_callback( $plugin );
$plugin(array<string, mixed>) (required)
Plugin data array to check against the search term.

Notes

Global. String. $s URL encoded search term.

Changelog

Since 3.1.0 Introduced.

WP_Plugins_List_Table::_search_callback() code WP 7.1

public function _search_callback( $plugin ) {
	global $s;

	foreach ( $plugin as $value ) {
		if ( is_string( $value ) && false !== stripos( strip_tags( $value ), urldecode( $s ) ) ) {
			return true;
		}
	}

	return false;
}