get_template();
$stylesheet = $theme->get_stylesheet();
$title = $theme->display( 'Name' );
$version = $theme->display( 'Version' );
$author = $theme->display( 'Author' );
$activate_link = wp_nonce_url( 'themes.php?action=activate&template=' . urlencode( $template ) . '&stylesheet=' . urlencode( $stylesheet ), 'switch-theme_' . $stylesheet );
$actions = array();
$actions['activate'] = sprintf(
'
%s',
$activate_link,
/* translators: %s: Theme name. */
esc_attr( sprintf( _x( 'Activate “%s”', 'theme' ), $title ) ),
__( 'Activate' )
);
if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {
$actions['preview'] .= sprintf(
'
%s',
wp_customize_url( $stylesheet ),
__( 'Live Preview' )
);
}
if ( ! is_multisite() && current_user_can( 'delete_themes' ) ) {
$actions['delete'] = sprintf(
'
%s',
wp_nonce_url( 'themes.php?action=delete&stylesheet=' . urlencode( $stylesheet ), 'delete-theme_' . $stylesheet ),
/* translators: %s: Theme name. */
esc_js( sprintf( __( "You are about to delete this theme '%s'\n 'Cancel' to stop, 'OK' to delete." ), $title ) ),
__( 'Delete' )
);
}
/** This filter is documented in wp-admin/includes/class-wp-ms-themes-list-table.php */
$actions = apply_filters( 'theme_action_links', $actions, $theme, 'all' );
/** This filter is documented in wp-admin/includes/class-wp-ms-themes-list-table.php */
$actions = apply_filters( "theme_action_links_{$stylesheet}", $actions, $theme, 'all' );
$delete_action = isset( $actions['delete'] ) ? '
' . $actions['delete'] . '
' : '';
unset( $actions['delete'] );
$screenshot = $theme->get_screenshot();
?>
display( 'Description' ); ?>
parent() ) {
printf(
/* translators: 1: Link to documentation on child themes, 2: Name of parent theme. */
'
' . __( 'This child theme requires its parent theme, %2$s.' ) . '
',
__( 'https://developer.wordpress.org/themes/advanced-topics/child-themes/' ),
$theme->parent()->display( 'Name' )
);
}
?>
features as $word ) {
if ( ! in_array( $word, $theme->get( 'Tags' ), true ) ) {
return false;
}
}
// Match all phrases.
foreach ( $this->search_terms as $word ) {
if ( in_array( $word, $theme->get( 'Tags' ), true ) ) {
continue;
}
foreach ( array( 'Name', 'Description', 'Author', 'AuthorURI' ) as $header ) {
// Don't mark up; Do translate.
if ( false !== stripos( strip_tags( $theme->display( $header, false, true ) ), $word ) ) {
continue 2;
}
}
if ( false !== stripos( $theme->get_stylesheet(), $word ) ) {
continue;
}
if ( false !== stripos( $theme->get_template(), $word ) ) {
continue;
}
return false;
}
return true;
}
/**
* Send required variables to JavaScript land
*
* @since 3.4.0
*
* @param array $extra_args
*/
public function _js_vars( $extra_args = array() ) {
$search_string = isset( $_REQUEST['s'] ) ? esc_attr( wp_unslash( $_REQUEST['s'] ) ) : '';
$args = array(
'search' => $search_string,
'features' => $this->features,
'paged' => $this->get_pagenum(),
'total_pages' => ! empty( $this->_pagination_args['total_pages'] ) ? $this->_pagination_args['total_pages'] : 1,
);
if ( is_array( $extra_args ) ) {
$args = array_merge( $args, $extra_args );
}
printf( "\n", wp_json_encode( $args ) );
parent::_js_vars();
}
}