本文整理匯總了PHP中WP_Theme::get_screenshot方法的典型用法代碼示例。如果您正苦於以下問題:PHP WP_Theme::get_screenshot方法的具體用法?PHP WP_Theme::get_screenshot怎麽用?PHP WP_Theme::get_screenshot使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WP_Theme
的用法示例。
在下文中一共展示了WP_Theme::get_screenshot方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: get_theme_info_html
protected function get_theme_info_html(WP_Theme $theme)
{
$name = $theme->display('Name');
$version = $theme->display('Version');
$description = $theme->display('Description');
$desc_title = esc_attr($theme->get('Description'));
$author = $theme->display('Author');
$screenshot = $theme->get_screenshot();
$thumbnail_style = $screenshot !== false ? sprintf('style="background-image:url(%s);"', $screenshot) : '';
$theme_url = network_admin_url(add_query_arg('theme', $theme->get_stylesheet(), 'themes.php'));
$version_label = __('Version:', 'wtaiu');
$author_label = __('By', 'wtaiu');
$output = <<<OUTPUT
<div class="theme-info" title="{$desc_title}">
<a href="{$theme_url}" class="theme-screenshot" {$thumbnail_style}></a>
<div class="theme-info-wrap">
<h3 class="theme-info-header" title="{$name}">
<a href="{$theme_url}" class="theme-name">{$name}</a>
</h3>
<p class="theme-version">{$version_label} {$version}</p>
<p class="theme-author">{$author_label} {$author}</p>
</div>
</div>
OUTPUT;
return $output;
}