本文整理汇总了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;
}