本文整理汇总了PHP中ts_essentials_escape函数的典型用法代码示例。如果您正苦于以下问题:PHP ts_essentials_escape函数的具体用法?PHP ts_essentials_escape怎么用?PHP ts_essentials_escape使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ts_essentials_escape函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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']);
}
示例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']);
}
示例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']);
}
示例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']);
}
示例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']);
}
示例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']);
}
示例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']);
}
}
示例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']);
}
示例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']);
}
示例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']);
}
}
示例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']);
}
示例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']);
}
示例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']);
}
示例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']);
}
示例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']);
}