WP_MS_Themes_List_Table::_search_callback
Filters a theme by the search term.
Метод класса: WP_MS_Themes_List_Table{}
Хуков нет.
Возвращает
true|false. True if the theme matches the search term, false otherwise.
Использование
$WP_MS_Themes_List_Table = new WP_MS_Themes_List_Table(); $WP_MS_Themes_List_Table->_search_callback( $theme );
- $theme(WP_Theme) (обязательный)
- The WP_Theme object to check.
Код WP_MS_Themes_List_Table::_search_callback() WP MS Themes List Table:: search callback WP 7.0
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;
}