WP_MS_Themes_List_Table::_search_callback() WordPress Method

The WP_MS_Themes_List_Table::_search_callback() method is used to filter the themes displayed in the WordPress Multisite themes list table. Themes are filtered by the search string entered in the search field.

WP_MS_Themes_List_Table::_search_callback( WP_Theme $theme ) #


Parameters

$theme

(WP_Theme)(Required)


Top ↑

Return

(bool)


Top ↑

Source

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

	public function _search_callback( $theme ) {
		static $term = null;
		if ( is_null( $term ) ) {
			$term = wp_unslash( $_REQUEST['s'] );
		}

		foreach ( array( 'Name', 'Description', 'Author', 'Author', 'AuthorURI' ) as $field ) {
			// Don't mark up; Do translate.
			if ( false !== stripos( $theme->display( $field, false, true ), $term ) ) {
				return true;
			}
		}

		if ( false !== stripos( $theme->get_stylesheet(), $term ) ) {
			return true;
		}

		if ( false !== stripos( $theme->get_template(), $term ) ) {
			return true;
		}

		return false;
	}

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.