本文整理汇总了PHP中ts_essentials_escape函数的典型用法代码示例。如果您正苦于以下问题:PHP ts_essentials_escape函数的具体用法?PHP ts_essentials_escape怎么用?PHP ts_essentials_escape使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ts_essentials_escape函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: widget
function widget($args, $instance)
{
$title = $instance['title'];
$bio = $instance['bio'];
$custom_email = $instance['custom_email'];
$avatar_size = preg_replace("/[^0-9]/", "", $instance['avatar_size']);
if (!$avatar_size) {
$avatar_size = 48;
}
$avatar_align = $instance['avatar_align'];
if (!$avatar_align) {
$avatar_align = 'left';
}
$read_more_text = $instance['read_more_text'] ? $instance['read_more_text'] : 'Read more';
$read_more_url = $instance['read_more_url'];
echo ts_essentials_escape($args['before_widget']);
if (!empty($title)) {
echo ts_essentials_escape($args['before_title'] . apply_filters('widget_title', $title) . $args['after_title']);
}
echo '<div class="blog-author clearfix">';
$avatar = $custom_email ? '<span class="align' . esc_attr($avatar_align) . '">' . get_avatar($custom_email, $avatar_size) . '</span>' : '';
?>
<p><?php
echo wp_kses_post($avatar . $bio);
?>
</p>
<?php
if ($read_more_url) {
echo '<div class="mimic-smaller read-more uppercase"><a href="' . esc_url($read_more_url) . '">' . esc_html($read_more_text) . '</a></div>';
}
echo '</div>';
echo ts_essentials_escape($args['after_widget']);
}
开发者ID:dqishmirian,项目名称:jrrny,代码行数:33,代码来源:blog-author.php
示例2: widget
function widget($args, $instance)
{
$title = $instance['title'];
$flickrid = $instance['flickrid'];
$number = $instance['number'];
echo ts_essentials_escape($args['before_widget']);
if (!empty($title)) {
echo ts_essentials_escape($args['before_title'] . apply_filters('widget_title', $title) . $args['after_title']);
}
?>
<div class="flickr ts-mfp-gallery">
<ul id="<?php
echo esc_attr($args['widget_id']);
?>
-ul" class="flickr-widget clearfix"></ul>
<div><script type="text/javascript">jQuery(document).ready(function($){if ($.fn.jflickrfeed){jQuery('#<?php
echo esc_js($args['widget_id']);
?>
-ul').jflickrfeed({limit: <?php
echo absint($number);
?>
,qstrings: { id: '<?php
echo esc_js($flickrid);
?>
' }}, function(data){if(typeof(ts_magnificPopup)=="function"){ ts_magnificPopup()}})}});</script></div>
</div>
<?php
echo ts_essentials_escape($args['after_widget']);
}
开发者ID:dqishmirian,项目名称:jrrny,代码行数:30,代码来源:flickr.php
示例3: widget
function widget($args, $instance)
{
$facebook = $instance['facebook'];
$title = $instance['label'];
$twitter = $instance['twitter'];
$consumer_key = isset($instance['consumer_key']) ? $instance['consumer_key'] : '';
$consumer_secret = isset($instance['consumer_secret']) ? $instance['consumer_secret'] : '';
$access_token = isset($instance['access_token']) ? $instance['access_token'] : '';
$access_token_secret = isset($instance['access_token_secret']) ? $instance['access_token_secret'] : '';
$last_twitter_save = get_option('ts_last_twitter_follower_count_save_' . $twitter);
$last_twitter_reponse = get_option('ts_last_twitter_follower_count_response_' . $twitter);
$last_twitter_reponse = $last_twitter_reponse ? json_decode($last_twitter_reponse, true) : '';
if ($last_twitter_save && time() - $last_twitter_save < 600 && $last_twitter_reponse && count($last_twitter_reponse) > 0) {
//$last_twitter_reponse = json_decode($last_twitter_reponse, true);
} else {
$twitter_config = array('consumer_key' => $consumer_key, 'consumer_secret' => $consumer_secret, 'token' => $access_token, 'secret' => $access_token_secret);
$tmhOAuth = new tmhOAuth($twitter_config);
$params = array('screen_name' => $twitter);
$code = $tmhOAuth->user_request(array('method' => 'GET', 'url' => $tmhOAuth->url("1.1/users/show"), 'params' => $params));
if ($code == 200) {
$last_twitter_reponse = $tmhOAuth->response['response'];
$last_twitter_reponse_error = $last_twitter_reponse;
update_option('ts_last_twitter_follower_count_save_' . $twitter, time());
update_option('ts_last_twitter_follower_count_response_' . $twitter, $last_twitter_reponse);
$last_twitter_reponse = json_decode($last_twitter_reponse, true);
}
}
echo ts_essentials_escape($args['before_widget']);
echo '<div class="inner clearfix">';
if (!empty($title)) {
echo ts_essentials_escape($args['before_title'] . apply_filters('widget_title', $title) . $args['after_title']);
}
if ($facebook) {
$data = wp_remote_get('https://api.facebook.com/method/links.getStats?urls=' . urlencode('https://www.facebook.com/' . $facebook) . '&format=json');
$fb_error = is_object($data) && get_class($data) == 'WP_Error' ? true : false;
if (!$fb_error && isset($data['body'])) {
$data = json_decode($data['body']);
$data = isset($data[0]) && is_object($data[0]) ? $data[0] : $data;
if (isset($data->like_count)) {
echo '<div class="inline-block"><a href="https://facebook.com/' . esc_attr($facebook) . '" class="facebook">';
echo '<i class="fa fa-facebook facebook-bg-color"></i>';
echo '<h4 class="sp1" title="' . esc_attr($data->like_count) . '">' . ts_essentials_num2str($data->like_count) . '</h4>';
echo '<span class="sp2 small">Likes</span>';
echo '</a></div>';
}
}
}
if ($twitter && is_array($last_twitter_reponse)) {
$data = $last_twitter_reponse;
if (isset($data['followers_count'])) {
echo '<div class="inline-block"><a href="https://twitter.com/' . esc_attr($twitter) . '" class="twitter">';
echo '<i class="fa fa-twitter twitter-bg-color"></i>';
echo '<h4 class="sp1" title="' . esc_attr($data['followers_count']) . '">' . ts_essentials_num2str($data['followers_count']) . '</h4>';
echo '<span class="sp2 small">Followers</span>';
echo '</a></div>';
}
}
echo '</div>';
echo ts_essentials_escape($args['after_widget']);
}
开发者ID:dqishmirian,项目名称:jrrny,代码行数:60,代码来源:facebook-twitter.php
示例4: widget
function widget($args, $instance)
{
$title = $instance['title'];
$contact = $instance['contact'];
echo ts_essentials_escape($args['before_widget']);
if (!empty($title)) {
echo ts_essentials_escape($args['before_title'] . apply_filters('widget_title', $title) . $args['after_title']);
}
echo '<div class="contact-form-7">' . do_shortcode('[contact-form-7 id="' . esc_attr($contact) . '" title="' . esc_attr($title) . '"]') . '</div>';
echo ts_essentials_escape($args['after_widget']);
}
开发者ID:dqishmirian,项目名称:jrrny,代码行数:11,代码来源:contact.php
示例5: widget
function widget($args, $instance)
{
$title = $instance['title'];
$limit = $instance['limit'];
$orderby = isset($instance['orderby']) ? $instance['orderby'] : '';
echo ts_essentials_escape($args['before_widget']);
if (!empty($title)) {
echo ts_essentials_escape($args['before_title'] . apply_filters('widget_title', $title) . $args['after_title']);
}
echo '<div class="portfolio-mini-widget-inner clearfix">';
echo do_shortcode('[portfolio layout="mini" limit="' . esc_attr($limit) . '" called_via="widget" orderby="' . esc_attr($orderby) . '"][/portfolio]');
echo '</div>';
echo ts_essentials_escape($args['after_widget']);
}
开发者ID:estvmachine,项目名称:nicowp,代码行数:14,代码来源:portfolio-mini.php
示例6: widget
function widget($args, $instance)
{
$title = $instance['title'];
$num = $instance['num'];
echo ts_essentials_escape($args['before_widget']);
if (!empty($title)) {
echo ts_essentials_escape($args['before_title'] . apply_filters('widget_title', $title) . $args['after_title']);
}
echo '<ul>';
$recentPosts = '';
$temp = $recentPosts;
$recentPosts = new WP_Query(array('showposts' => $num));
while ($recentPosts->have_posts()) {
$recentPosts->the_post();
$img_url = false;
$img_id = get_post_thumbnail_id($recentPosts->post->ID);
$photo = wp_get_attachment_image_src($img_id, 'thumbnail');
$img_url = isset($photo[0]) ? $photo[0] : '';
$has_img = $img_url ? 'has-img' : '';
if ($img_url) {
?>
<li class="portfolio-post-widget clearfix">
<div class="portfolio-post-widget-thumbnail">
<a href="<?php
echo get_permalink($recentPosts->post->ID);
?>
" class="thumb-link">
<img width="75" src="<?php
echo esc_url($img_url);
?>
" alt="<?php
echo esc_attr(get_the_title());
?>
"/>
</a>
</div><!-- / div.widget-thumbnail -->
</li><!-- end div.post-widget -->
<?php
}
}
$recentPosts = $temp;
echo '</ul>';
echo ts_essentials_escape($args['after_widget']);
}
开发者ID:estvmachine,项目名称:nicowp,代码行数:46,代码来源:recent-portfolio.php
示例7: widget
function widget($args, $instance)
{
$title = $instance['title'];
$style = $instance['style'];
$menu = $instance['menu'];
if ($menu) {
echo ts_essentials_escape($args['before_widget']);
if (!empty($title)) {
echo ts_essentials_escape($args['before_title'] . apply_filters('widget_title', $title) . $args['after_title']);
}
echo '<div class="ts-custom-menu-wrap ts-menu-style-' . esc_attr($style) . '">';
$nav_menu_options = array('menu' => $menu);
wp_nav_menu($nav_menu_options);
echo '</div>';
echo ts_essentials_escape($args['after_widget']);
}
}
开发者ID:dqishmirian,项目名称:jrrny,代码行数:17,代码来源:custom-menu.php
示例8: widget
function widget($args, $instance)
{
$label = $instance['label'];
$facebook = $instance['facebook'];
$twitter = $instance['twitter'];
$pinterest = $instance['pinterest'];
$google_plus = $instance['google_plus'];
$github = $instance['github'];
$linkedin = $instance['linkedin'];
$instagram = $instance['instagram'];
$flickr = $instance['flickr'];
$youtube = $instance['youtube'];
$vimeo = $instance['vimeo'];
$tumblr = $instance['tumblr'];
$vk = isset($instance['vk']) ? $instance['vk'] : '';
$behance = $instance['behance'];
$dribbble = $instance['dribbble'];
$soundcloud = $instance['soundcloud'];
$rss = $instance['rss'];
echo ts_essentials_escape($args['before_widget']);
echo '<div class="inner social-icons-widget-style">';
if (!empty($title)) {
echo ts_essentials_escape($args['before_title'] . apply_filters('widget_title', $title) . $args['after_title']);
}
echo '<div class="social social-fa-icons">';
echo ts_essentials_output_social_icon('facebook', '', $facebook);
echo ts_essentials_output_social_icon('twitter', '', $twitter);
echo ts_essentials_output_social_icon('pinterest', '', $pinterest);
echo ts_essentials_output_social_icon('google_plus', '', $google_plus);
echo ts_essentials_output_social_icon('github', '', $github);
echo ts_essentials_output_social_icon('linkedin', '', $linkedin);
echo ts_essentials_output_social_icon('instagram', '', $instagram);
echo ts_essentials_output_social_icon('flickr', '', $flickr);
echo ts_essentials_output_social_icon('youtube', '', $youtube);
echo ts_essentials_output_social_icon('vimeo', '', $vimeo);
echo ts_essentials_output_social_icon('vk', '', $vk);
echo ts_essentials_output_social_icon('tumblr', '', $tumblr);
echo ts_essentials_output_social_icon('behance', '', $behance);
echo ts_essentials_output_social_icon('dribbble', '', $dribbble);
echo ts_essentials_output_social_icon('soundcloud', '', $soundcloud);
echo ts_essentials_output_social_icon('rss', '', $rss);
echo '</div>';
echo '</div>';
echo ts_essentials_escape($args['after_widget']);
}
开发者ID:estvmachine,项目名称:nicowp,代码行数:45,代码来源:social-icons.php
示例9: widget
function widget($args, $instance)
{
$title = trim($instance['title']) ? $instance['title'] : __('Follow Our RSS Feed', 'ThemeStockyard');
$label = $instance['label'];
$description = trim($instance['description']) ? $instance['description'] : __('Stay up to date with the latest news by following our feed.', 'ThemeStockyard');
$feedurl = trim($instance['feedurl']) ? $instance['feedurl'] : get_bloginfo('rss2_url');
echo ts_essentials_escape($args['before_widget']);
echo '<div class="inner">';
if (!empty($title)) {
echo ts_essentials_escape($args['before_title'] . apply_filters('widget_title', $title) . $args['after_title']);
}
echo '<a href="' . esc_url($feedurl) . '">';
echo '<i class="fa fa-rss rss-bg-color"></i>';
echo '<h4 class="sp1">' . esc_html($title) . '</h4>';
echo '<span class="sp2 small">' . esc_html($description) . '</span>';
echo '</a>';
echo '</div>';
echo ts_essentials_escape($args['after_widget']);
}
开发者ID:dqishmirian,项目名称:jrrny,代码行数:19,代码来源:follow-rss.php
示例10: widget
function widget($args, $instance)
{
$map_ok = true;
wp_enqueue_script('googlemaps');
$title = $instance['title'];
$address = $instance['address'];
$coordinates = $instance['coordinates'];
$zoom = $instance['zoom'];
$height = preg_replace("/[^0-9]/", "", $instance['height']);
if (!$height) {
$height = 250;
}
if (trim($address) || trim($coordinates)) {
echo ts_essentials_escape($args['before_widget']);
if (!empty($title)) {
echo ts_essentials_escape($args['before_title'] . apply_filters('widget_title', $title) . $args['after_title']);
}
if (!$address) {
_e('Address was not specified', 'ThemeStockyard');
return false;
}
if (!$coordinates) {
$coordinates = ts_essentials_get_map_coordinates($address);
if (is_array($coordinates)) {
$coordinates = $coordinates['lat'] . ',' . $coordinates['lng'];
} else {
$map_ok = false;
echo esc_html($coordinates);
//return false;
}
}
if ($map_ok) {
$map_id_num = rand(1, 100);
echo '<div id="map_canvas_' . esc_attr($map_id_num) . '_wrap" class="flexible-map" style="width:100%;height:' . esc_attr($height) . 'px" data-height="' . $height . 'px">';
echo '<input class="location" type="hidden" value="' . esc_attr($address) . '" />';
echo '<input class="coordinates" type="hidden" value="' . esc_attr($coordinates) . '" />';
echo '<input class="zoom" type="hidden" value="' . esc_attr($zoom) . '" />';
echo '<div id="map_canvas_' . esc_attr($map_id_num) . '" class="map_canvas" style="width:100%;height:' . esc_attr($height) . 'px"> </div>';
echo '</div>';
}
echo ts_essentials_escape($args['after_widget']);
}
}
开发者ID:dqishmirian,项目名称:jrrny,代码行数:43,代码来源:google-map.php
示例11: widget
function widget($args, $instance)
{
$url = isset($instance['url']) && trim($instance['url']) ? $instance['url'] : ts_essentials_full_url();
$label = $instance['label'];
$description = $instance['description'];
echo ts_essentials_escape($args['before_widget']);
echo '<div class="inner">';
if (!empty($title)) {
echo ts_essentials_escape($args['before_title'] . apply_filters('widget_title', $title) . $args['after_title']);
}
echo '<div><iframe src="//www.facebook.com/plugins/like.php?href=' . urlencode($url);
echo '&send=false&layout=standard&width=300&show_faces=false';
echo '&font&colorscheme=light&action=like&height=35"';
echo ' style="border:none; overflow:hidden; width:300px; height:35px;"';
echo '></iframe></div>';
echo isset($description) && trim($description) ? '<p class="description">' . wp_kses_post($description) . '</p>' : '';
echo '</div>';
echo ts_essentials_escape($args['after_widget']);
}
开发者ID:dqishmirian,项目名称:jrrny,代码行数:19,代码来源:facebook-like.php
示例12: widget
function widget($args, $instance)
{
$label = $instance['label'];
$facebook = trim($instance['facebook_username']);
$twitter = trim($instance['twitter_username']);
$pinterest = trim($instance['pinterest_username']);
$gplus = isset($instance['gplus_username']) ? trim($instance['gplus_username']) : '';
$orientation = $instance['orientation'];
$align = $instance['align'];
$align = in_array($align, array('left', 'center', 'right')) ? 'text-' . $align : 'text-left';
$align = $orientation == 'horizontal' ? $align : 'text-left';
echo ts_essentials_escape($args['before_widget']);
echo '<div class="inner ' . esc_attr($align) . '">';
if (!empty($title)) {
echo ts_essentials_escape($args['before_title'] . apply_filters('widget_title', $title) . $args['after_title']);
}
echo '<div class="stuff">';
$orientation_class = $orientation == 'horizontal' ? 'inline-block' : 'block';
if ($facebook) {
$pre = is_numeric($facebook) ? 'https://www.facebook.com/profile.php?id=' : 'https://www.facebook.com/';
$facebook = substr($facebook, 0, 4) == 'http' ? $facebook : $pre . $facebook;
echo '<div class="fb ' . esc_attr($orientation_class) . '">';
echo '<iframe src="//www.facebook.com/plugins/like.php?href=' . urlencode($facebook);
echo '&send=false&layout=button_count&width=70&show_faces=false';
echo '&font&colorscheme=light&action=like&height=21"';
echo ' style="border:none; overflow:hidden; width:300px; height:35px;"';
echo '></iframe></div>';
}
if ($twitter) {
echo '<div class="tw ' . esc_attr($orientation_class) . '">';
echo '<a href="https://twitter.com/' . esc_attr($twitter) . '" class="twitter-follow-button"';
echo ' data-show-count="false">Follow @' . esc_html($twitter) . '</a>';
echo "<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script></div>";
}
if ($pinterest) {
echo '<div class="pn ' . esc_attr($orientation_class) . '">';
echo '<a href="http://www.pinterest.com/' . esc_attr($pinterest) . '/" target="_blank">';
echo esc_html($pinterest) . '<b></b><i></i></a></div>';
}
echo '</div>';
echo '</div>';
echo ts_essentials_escape($args['after_widget']);
}
开发者ID:dqishmirian,项目名称:jrrny,代码行数:43,代码来源:social-buttons.php
示例13: widget
function widget($args, $instance)
{
$title = isset($instance['title']) ? $instance['title'] : '';
$adcode = isset($instance['adcode']) ? $instance['adcode'] : '';
$image = isset($instance['image']) ? $instance['image'] : '';
$href = isset($instance['href']) ? $instance['href'] : '';
$alt = isset($instance['alt']) ? $instance['alt'] : '';
echo ts_essentials_escape($args['before_widget']);
if (!empty($title)) {
echo ts_essentials_escape($args['before_title'] . apply_filters('widget_title', $title) . $args['after_title']);
}
if (trim($adcode)) {
echo '<div class="adspace">' . balanceTags($adcode) . '</div>';
// need some flexibility here due to google ad codes
} else {
$open = trim($href) ? '<a href="' . esc_url($href) . '">' : '';
$close = trim($href) ? '</a>' : '';
echo strip_tags('<div class="adspace">' . $open . '<img src="' . esc_url($image) . '" alt="' . esc_attr($alt) . '" />' . $close . '</div>', '<div><a><img>');
}
echo ts_essentials_escape($args['after_widget']);
}
开发者ID:dqishmirian,项目名称:jrrny,代码行数:21,代码来源:ad-space.php
示例14: widget
function widget($args, $instance)
{
$title = $instance['title'];
$limit = $instance['limit'];
$category_name = $instance['category_name'];
$exclude_previous_posts = $instance['exclude_previous_posts'];
$exclude_these_later = $instance['exclude_these_later'];
$text_align = $instance['text_align'];
$show_meta = $instance['show_meta'];
$allow_videos = $instance['allow_videos'];
$image_size = $instance['image_size'];
$title_size = $instance['title_size'];
echo ts_essentials_escape($args['before_widget']);
if (!empty($title)) {
echo ts_essentials_escape($args['before_title'] . apply_filters('widget_title', $title) . $args['after_title']);
}
echo '<div class="blog-slider-widget-inner clearfix">';
echo do_shortcode('[blog_slider limit="' . esc_attr($limit) . '" category_name="' . esc_attr($category_name) . '" exclude_previous_posts="' . esc_attr($exclude_previous_posts) . '" exclude_these_later="' . esc_attr($exclude_these_later) . '" text_align="' . esc_attr($text_align) . '" allow_videos="' . esc_attr($allow_videos) . '" show_excerpt="no" show_meta="' . esc_attr($show_meta) . '" title_size="' . esc_attr($title_size) . '" image_size="' . esc_attr($image_size) . '"][/blog_slider]');
echo '</div>';
echo ts_essentials_escape($args['after_widget']);
}
开发者ID:estvmachine,项目名称:nicowp,代码行数:21,代码来源:blog-slider.php
示例15: widget
function widget($args, $instance)
{
$icon = isset($instance['icon']) ? $instance['icon'] : '';
$icon_color = isset($instance['icon_color']) ? $instance['icon_color'] : '';
$label = isset($instance['label']) ? $instance['label'] : '';
$title = isset($instance['title']) ? $instance['title'] : '';
$description = isset($instance['description']) ? $instance['description'] : '';
$url = isset($instance['url']) ? $instance['url'] : '';
echo ts_essentials_escape($args['before_widget']);
if (!empty($title)) {
echo ts_essentials_escape($args['before_title'] . apply_filters('widget_title', $title) . $args['after_title']);
}
$infobox_class = $url ? 'has-url' : 'has-no-url';
$infobox_class .= $icon ? ' has-icon' : ' has-icon';
echo '<div class="infobox ' . esc_attr($infobox_class) . '">';
echo trim($url) ? '<a href="' . esc_url($url) . '" class="link">' : '<div class="link">';
echo trim($icon) ? '<i class="' . ts_essentials_fontawesome_class($icon) . '" style="background:' . esc_attr($icon_color) . '"></i>' : '';
echo trim($title) ? '<h4 class="sp1">' . esc_html($title) . '</h4>' : '';
echo trim($description) ? '<span class="sp2 small">' . esc_html($description) . '</span>' : '';
echo trim($url) ? '</a>' : '</div>';
echo '</div>';
echo ts_essentials_escape($args['after_widget']);
}
开发者ID:dqishmirian,项目名称:jrrny,代码行数:23,代码来源:info-box.php
示例16: widget
function widget($args, $instance)
{
$title = $instance['title'];
$title_link = isset($instance['title_link']) ? $instance['title_link'] : '';
$widget_layout = $instance['widget_layout'];
$limit = $instance['limit'];
$category_name = isset($instance['category_name']) ? $instance['category_name'] : '';
$category_name = is_array($category_name) ? implode(',', $category_name) : $category_name;
$cat = isset($instance['cat']) ? $instance['cat'] : '';
$cat = is_array($cat) ? implode(',', $cat) : $cat;
$exclude_previous_posts = $instance['exclude_previous_posts'];
$exclude_these_later = $instance['exclude_these_later'];
$show_excerpt = $instance['show_excerpt'];
$show_meta = $instance['show_meta'];
$show_media = $instance['show_media'];
$allow_videos = $instance['allow_videos'];
$allow_galleries = $instance['allow_galleries'];
$orderby = isset($instance['orderby']) ? $instance['orderby'] : '';
echo ts_essentials_escape($args['before_widget']);
if (!empty($title)) {
echo ts_essentials_escape($args['before_title']);
echo trim($title_link) ? '<a href="' . esc_attr($title_link) . '">' : '';
echo apply_filters('widget_title', $title);
echo trim($title_link) ? '<i class="fa fa-angle-right"></i></a>' : '';
echo ts_essentials_escape($args['after_title']);
}
echo '<div class="blog-mini-widget-inner clearfix">';
if (isset($instance['cat'])) {
// backwords compatibility
echo do_shortcode('[blog_widget widget_layout="' . esc_attr($widget_layout) . '" limit="' . esc_attr($limit) . '" cat="' . esc_attr($cat) . '" override_widget_heading="no" exclude_previous_posts="' . esc_attr($exclude_previous_posts) . '" exclude_these_later="' . esc_attr($exclude_these_later) . '" show_excerpt="' . esc_attr($show_excerpt) . '" show_meta="' . esc_attr($show_meta) . '" show_media="' . esc_attr($show_media) . '" allow_videos="' . esc_attr($allow_videos) . '" allow_galleries="' . esc_attr($allow_galleries) . '" called_via="widget" orderby="' . esc_attr($orderby) . '"][/blog_widget]');
} else {
echo do_shortcode('[blog_widget widget_layout="' . esc_attr($widget_layout) . '" limit="' . esc_attr($limit) . '" category_name="' . esc_attr($category_name) . '" override_widget_heading="no" exclude_previous_posts="' . esc_attr($exclude_previous_posts) . '" exclude_these_later="' . esc_attr($exclude_these_later) . '" show_excerpt="' . esc_attr($show_excerpt) . '" show_meta="' . esc_attr($show_meta) . '" show_media="' . esc_attr($show_media) . '" allow_videos="' . esc_attr($allow_videos) . '" allow_galleries="' . esc_attr($allow_galleries) . '" called_via="widget" orderby="' . esc_attr($orderby) . '"][/blog_widget]');
}
echo '</div>';
echo ts_essentials_escape($args['after_widget']);
}
开发者ID:dqishmirian,项目名称:jrrny,代码行数:36,代码来源:blog-mini.php
示例17: widget
function widget($args, $instance)
{
global $wpdb, $post;
$tab1 = $instance['tab1'];
$tab2 = $instance['tab2'];
$tab3 = $instance['tab3'];
$crop_thumbs = isset($instance['crop_thumbs']) ? $instance['crop_thumbs'] : 1;
$count = ctype_digit($instance['count']) && ts_essentials_number_within_range($instance['count'], 1, 20) ? $instance['count'] : 5;
echo ts_essentials_escape($args['before_widget']);
echo '<div class="ts-tabs-widget tabs-widget shortcode-tabs simple-tabs horizontal-tabs">';
$tab = array();
?>
<div class="tab-widget">
<ul class="tab-header clearfix">
<li class="active"><?php
echo esc_html($tab1);
?>
</li>
<li><?php
echo esc_html($tab2);
?>
</li>
<li class="last"><?php
echo esc_html($tab3);
?>
</li>
</ul>
<div class="tab-contents">
<div class="tab-context visible">
<ul>
<?php
$popular_posts = '';
$temp = $popular_posts;
$popular_posts = new WP_Query(array('showposts' => intval($count), 'orderby' => 'comment_count'));
while ($popular_posts->have_posts()) {
$popular_posts->the_post();
?>
<li class="post-widget clearfix">
<?php
$img_url = false;
$size = 'thumbnail';
$img_id = get_post_thumbnail_id($popular_posts->post->ID);
$photo = wp_get_attachment_image_src($img_id, $size);
$img_url = isset($photo[0]) ? $photo[0] : '';
$has_img = $img_url ? 'has-img' : '';
if ($img_url) {
?>
<div class="widget-thumbnail">
<a href="<?php
echo get_permalink($popular_posts->post->ID);
?>
" class="thumb-link">
<img width="60" src="<?php
echo esc_url($img_url);
?>
" alt="<?php
echo esc_attr(get_the_title());
?>
"/>
</a>
</div><!-- / div.widget-thumbnail -->
<?php
}
?>
<div class="widget-context <?php
echo esc_attr($has_img);
?>
">
<h4><a href="<?php
echo get_permalink($popular_posts->post->ID);
?>
"><?php
the_title();
?>
</a></h4>
<small><?php
the_time('F j, Y');
?>
</small>
</div><!-- / div.widget-context -->
</li><!-- / div.post-widget -->
<?php
}
$popular_posts = $temp;
echo '</ul></div>';
echo '<div class="tab-context"><ul>';
$recentPosts = '';
$temp = $recentPosts;
$recentPosts = new WP_Query(array('showposts' => intval($count)));
while ($recentPosts->have_posts()) {
$recentPosts->the_post();
?>
<li class="post-widget clearfix">
//.........这里部分代码省略.........
开发者ID:dqishmirian,项目名称:jrrny,代码行数:101,代码来源:tab.php
示例18: form
function form($instance)
{
$defaults = array('title' => __('Video', 'ThemeStockyard'), 'video' => '', 'url' => '');
$instance = wp_parse_args((array) $instance, $defaults);
$video = esc_textarea($instance['video']);
$url = esc_url($instance['url']);
?>
<p>
<label for="<?php
echo esc_attr($this->get_field_id('title'));
?>
"><?php
echo _e('Title:', 'ThemeStockyard');
?>
</label>
<input type="text" class="widefat" id="<?php
echo esc_attr($this->get_field_id('title'));
?>
" name="<?php
echo esc_attr($this->get_field_name('title'));
?>
" value="<?php
echo esc_attr($instance['title']);
?>
" />
</p>
<p><label for="<?php
echo esc_attr($this->get_field_id('url'));
?>
"><?php
echo _e('Video URL:', 'ThemeStockyard');
?>
</label>
<input type="text" class="widefat" id="<?php
echo esc_attr($this->get_field_id('url'));
?>
" name="<?php
echo esc_attr($this->get_field_name('url'));
?>
" value="<?php
echo esc_attr($instance['url']);
?>
" /></p>
<p><strong><?php
_e('-OR-', 'ThemeStockyard');
?>
</strong></p>
<p><label for="<?php
echo esc_attr($this->get_field_id('video'));
?>
"><?php
echo _e('Video Embed Code:', 'ThemeStockyard');
?>
</label>
<textarea class="widefat" rows="5" cols="20" id="<?php
echo esc_attr($this->get_field_id('video'));
?>
" name="<?php
echo esc_attr($this->get_field_name('video'));
?>
"><?php
echo ts_essentials_escape($video);
?>
</textarea></p>
<?php
}
开发者ID:dqishmirian,项目名称:jrrny,代码行数:70,代码来源:video.php
示例19: widget
function widget($args, $instance)
{
$title = $instance['title'];
$num = $instance['num'];
echo ts_essentials_escape($args['before_widget']);
if (!empty($title)) {
echo ts_essentials_escape($args['before_title'] . apply_filters('widget_title', $title) . $args['after_title']);
}
echo '<ul>';
$popular_posts = '';
$temp = $popular_posts;
$popular_posts = new WP_Query(array('showposts' => intval($num), 'orderby' => 'comment_count'));
while ($popular_posts->have_posts()) {
$popular_posts->the_post();
?>
<li class="post-widget clearfix">
<?php
$img_url = false;
$size = 'thumbnail';
$img_id = get_post_thumbnail_id($popular_posts->post->ID);
$photo = wp_get_attachment_image_src($img_id, $size);
$img_url = isset($photo[0]) ? $photo[0] : '';
$has_img = $img_url ? 'has-img' : '';
if ($img_url) {
?>
<div class="widget-thumbnail">
<a href="<?php
echo get_permalink($popular_posts->post->ID);
?>
" class="thumb-link">
<img width="60" src="<?php
echo esc_url($img_url);
?>
" alt="<?php
echo esc_attr($popular_posts->post->post_title);
?>
"/>
</a>
</div><!-- / div.widget-thumbnail -->
<?php
}
?>
<div class="widget-context <?php
echo esc_attr($has_img);
?>
">
<h4><a href="<?php
echo get_permalink($popular_posts->post->ID);
?>
"><?php
echo the_title();
?>
</a></h4>
<small><?php
echo get_the_time('F j, Y', $popular_posts->post->ID);
?>
</small>
</div><!-- / div.widget-context -->
</li><!-- / div.post-widget -->
<?php
}
$popular_posts = $temp;
echo '</ul>';
echo ts_essentials_escape($args['after_widget']);
}
开发者ID:dqishmirian,项目名称:jrrny,代码行数:67,代码来源:popular-post.php
示例20: widget
function widget($args, $instance)
{
$title = $instance['title'];
$username = isset($instance['username']) ? preg_replace("/[^a-zA-Z0-9\\-_]+/", "", $instance['username']) : '';
$number = isset($instance['number']) ? $instance['number'] : 3;
$consumer_key = isset($instance['consumer_key']) ? $instance['consumer_key'] : '';
$consumer_secret = isset($instance['consumer_secret']) ? $instance['consumer_secret'] : '';
$access_token = isset($instance['access_token']) ? $instance['access_token'] : '';
$access_token_secret = isset($instance['access_token_secret']) ? $instance['access_token_secret'] : '';
$links_in_new_tab = isset($instance['links_in_new_tab']
|
请发表评论