本文整理汇总了PHP中get_theme_feature_list函数的典型用法代码示例。如果您正苦于以下问题:PHP get_theme_feature_list函数的具体用法?PHP get_theme_feature_list怎么用?PHP get_theme_feature_list使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_theme_feature_list函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: translate_header
/**
* Translate a theme header.
*
* @access private
* @since 3.4.0
*
* @param string $header Theme header. Name, Description, Author, Version, ThemeURI, AuthorURI, Status.
* @param string $value Value to translate.
* @return string Translated value.
*/
private function translate_header($header, $value)
{
switch ($header) {
case 'Name':
// Cached for sorting reasons.
if (isset($this->name_translated)) {
return $this->name_translated;
}
$this->name_translated = translate($value, $this->get('TextDomain'));
return $this->name_translated;
case 'Tags':
if (empty($value)) {
return $value;
}
static $tags_list;
if (!isset($tags_list)) {
$tags_list = array();
$feature_list = get_theme_feature_list(false);
// No API
foreach ($feature_list as $tags) {
$tags_list += $tags;
}
}
foreach ($value as &$tag) {
if (isset($tags_list[$tag])) {
$tag = $tags_list[$tag];
}
}
return $value;
break;
default:
$value = translate($value, $this->get('TextDomain'));
}
return $value;
}
示例2: _e
<a id="filter-click" href="?filter=1"><?php
_e('Feature Filter');
?>
</a>
</p>
<br class="clear"/>
<div id="filter-box" style="<?php
if (empty($_REQUEST['filter'])) {
echo 'display: none;';
}
?>
">
<?php
$feature_list = get_theme_feature_list();
?>
<div class="feature-filter">
<p class="install-help"><?php
_e('Theme filters');
?>
</p>
<?php
if (!empty($_REQUEST['filter'])) {
?>
<input type="hidden" name="filter" value="1" />
<?php
}
?>
<?php
foreach ($feature_list as $feature_name => $features) {
示例3: install_themes_dashboard
/**
* Display tags filter for themes.
*
* @since 2.8.0
*/
function install_themes_dashboard()
{
install_theme_search_form();
?>
<h4><?php
_e('Feature Filter');
?>
</h4>
<form method="post" action="<?php
echo self_admin_url('theme-install.php?tab=search');
?>
">
<p class="install-help"><?php
_e('Find a theme based on specific features');
?>
</p>
<?php
$feature_list = get_theme_feature_list();
echo '<div class="feature-filter">';
foreach ((array) $feature_list as $feature_name => $features) {
$feature_name = esc_html($feature_name);
echo '<div class="feature-name">' . $feature_name . '</div>';
echo '<ol class="feature-group">';
foreach ($features as $feature => $feature_name) {
$feature_name = esc_html($feature_name);
$feature = esc_attr($feature);
?>
<li>
<input type="checkbox" name="features[<?php
echo $feature;
?>
]" id="feature-id-<?php
echo $feature;
?>
" value="<?php
echo $feature;
?>
" />
<label for="feature-id-<?php
echo $feature;
?>
"><?php
echo $feature_name;
?>
</label>
</li>
<?php
}
?>
</ol>
<br class="clear" />
<?php
}
?>
</div>
<br class="clear" />
<?php
submit_button(__('Find Themes'), 'button', 'search');
?>
</form>
<?php
}
示例4: renderThemesTable
public static function renderThemesTable($favoritesCallback = '')
{
if (!mainwp_current_user_can("dashboard", "install_themes")) {
mainwp_do_not_have_permissions(__('install themes', 'mainwp'));
return;
}
?>
<a href="#" class="mainwp_action left mainwp_action_down browse-themes" ><?php
_e('Search', 'mainwp');
?>
</a><a href="#" class="mainwp_action right upload" ><?php
_e('Upload', 'mainwp');
?>
</a>
<br class="clear" /><br />
<div class="mainwp_config_box_left" style="width: calc(100% - 290px);">
<div class="error below-h2" style="display: none;" id="ajax-error-zone"></div>
<div class="upload-theme">
<?php
MainWP_Install_Bulk::renderUpload('Themes');
?>
</div>
<div class="wp-filter">
<h3 class="mainwp_box_title"><?php
_e('Step 1: Select a Theme', 'mainwp');
?>
</h3>
<div class="filter-count">
<span class="count theme-count"></span>
</div>
<ul class="filter-links">
<li><a href="#" data-sort="featured"><?php
_ex('Featured', 'themes');
?>
</a></li>
<li><a href="#" data-sort="popular"><?php
_ex('Popular', 'themes');
?>
</a></li>
<li><a href="#" data-sort="new"><?php
_ex('Latest', 'themes');
?>
</a></li>
</ul>
<a class="drawer-toggle" href="#"><?php
_e('Feature Filter', 'mainwp');
?>
</a>
<div class="search-form"></div>
<div class="filter-drawer">
<div class="buttons">
<a class="apply-filters button button-secondary" href="#"><?php
_e('Apply Filters', 'mainwp');
?>
<span></span></a>
<a class="clear-filters button button-secondary" href="#"><?php
_e('Clear', 'mainwp');
?>
</a>
</div>
<?php
$feature_list = get_theme_feature_list();
foreach ($feature_list as $feature_name => $features) {
echo '<div class="filter-group">';
$feature_name = esc_html($feature_name);
echo '<h4>' . $feature_name . '</h4>';
echo '<ol class="feature-group">';
foreach ($features as $feature => $feature_name) {
$feature = esc_attr($feature);
echo '<li><input type="checkbox" id="filter-id-' . $feature . '" value="' . $feature . '" /> ';
echo '<label for="filter-id-' . $feature . '">' . $feature_name . '</label></li>';
}
echo '</ol>';
echo '</div>';
}
?>
<div class="filtered-by">
<span><?php
_e('Filtering by:', 'mainwp');
?>
</span>
<div class="tags"></div>
<a href="#"><?php
_e('Edit', 'mainwp');
?>
</a>
</div>
</div>
</div>
<div class="theme-browser content-filterable hide-if-upload"></div>
<div class="theme-install-overlay wp-full-overlay expanded"></div>
<p class="no-themes"><?php
_e('No themes found. Try a different search.');
?>
</p>
<span class="spinner"></span>
//.........这里部分代码省略.........
示例5: _e
<form class="search-form filter-form" action="" method="get">
<h3 class="available-themes"><?php _e('Available Themes'); ?></h3>
<?php if ( !empty( $_REQUEST['s'] ) || !empty( $_REQUEST['features'] ) || $wp_list_table->has_items() ) : ?>
<p class="search-box">
<label class="screen-reader-text" for="theme-search-input"><?php _e('Search Installed Themes'); ?>:</label>
<input type="search" id="theme-search-input" name="s" value="<?php _admin_search_query(); ?>" />
<?php submit_button( __( 'Search Installed Themes' ), 'button', false, false, array( 'id' => 'search-submit' ) ); ?>
<a id="filter-click" href="?filter=1"><?php _e( 'Feature Filter' ); ?></a>
</p>
<div id="filter-box" style="<?php if ( empty($_REQUEST['filter']) ) echo 'display: none;'; ?>">
<?php $feature_list = get_theme_feature_list(); ?>
<div class="feature-filter">
<p class="install-help"><?php _e('Theme filters') ?></p>
<?php if ( !empty( $_REQUEST['filter'] ) ) : ?>
<input type="hidden" name="filter" value="1" />
<?php endif; ?>
<?php foreach ( $feature_list as $feature_name => $features ) :
$feature_name = esc_html( $feature_name ); ?>
<div class="feature-container">
<div class="feature-name"><?php echo $feature_name ?></div>
<ol class="feature-group">
<?php foreach ( $features as $key => $feature ) :
$feature_name = $feature;
$feature_name = esc_html( $feature_name );
示例6: translate_header
/**
* Translate a theme header.
*
* @since 3.4.0
* @access private
*
* @staticvar array $tags_list
*
* @param string $header Theme header. Name, Description, Author, Version, ThemeURI, AuthorURI, Status, Tags.
* @param string $value Value to translate.
* @return string Translated value.
*/
private function translate_header($header, $value)
{
switch ($header) {
case 'Name':
// Cached for sorting reasons.
if (isset($this->name_translated)) {
return $this->name_translated;
}
$this->name_translated = translate($value, $this->get('TextDomain'));
return $this->name_translated;
case 'Tags':
if (empty($value) || !function_exists('get_theme_feature_list')) {
return $value;
}
static $tags_list;
if (!isset($tags_list)) {
$tags_list = array('black' => __('Black'), 'blue' => __('Blue'), 'brown' => __('Brown'), 'gray' => __('Gray'), 'green' => __('Green'), 'orange' => __('Orange'), 'pink' => __('Pink'), 'purple' => __('Purple'), 'red' => __('Red'), 'silver' => __('Silver'), 'tan' => __('Tan'), 'white' => __('White'), 'yellow' => __('Yellow'), 'dark' => __('Dark'), 'light' => __('Light'), 'fixed-layout' => __('Fixed Layout'), 'fluid-layout' => __('Fluid Layout'), 'responsive-layout' => __('Responsive Layout'), 'blavatar' => __('Blavatar'), 'photoblogging' => __('Photoblogging'), 'seasonal' => __('Seasonal'));
$feature_list = get_theme_feature_list(false);
// No API
foreach ($feature_list as $tags) {
$tags_list += $tags;
}
}
foreach ($value as &$tag) {
if (isset($tags_list[$tag])) {
$tag = $tags_list[$tag];
} elseif (isset(self::$tag_map[$tag])) {
$tag = $tags_list[self::$tag_map[$tag]];
}
}
return $value;
default:
$value = translate($value, $this->get('TextDomain'));
}
return $value;
}