• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP esc_url函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中esc_url函数的典型用法代码示例。如果您正苦于以下问题:PHP esc_url函数的具体用法?PHP esc_url怎么用?PHP esc_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了esc_url函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: start_el

 function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0)
 {
     $indent = $depth ? str_repeat("\t", $depth) : '';
     $classes = empty($item->classes) ? array() : (array) $item->classes;
     $classes[] = 'menu-item-' . $item->ID;
     $class_names = join(' ', apply_filters('nav_menu_css_class', array_filter($classes), $item, $args, $depth));
     /**
      * Change WP's default classes to match Foundation's required classes
      */
     $class_names = str_replace(array('menu-item-has-children'), array('has-submenu'), $class_names);
     // ==========================
     $class_names = $class_names ? ' class="' . esc_attr($class_names) . '"' : '';
     $id = apply_filters('nav_menu_item_id', 'menu-item-' . $item->ID, $item, $args, $depth);
     $id = $id ? ' id="' . esc_attr($id) . '"' : '';
     $output .= $indent . '<li' . $id . $class_names . '>';
     $atts = array();
     $atts['title'] = !empty($item->attr_title) ? $item->attr_title : '';
     $atts['target'] = !empty($item->target) ? $item->target : '';
     $atts['rel'] = !empty($item->xfn) ? $item->xfn : '';
     $atts['href'] = !empty($item->url) ? $item->url : '';
     $atts = apply_filters('nav_menu_link_attributes', $atts, $item, $args, $depth);
     $attributes = '';
     foreach ($atts as $attr => $value) {
         if (!empty($value)) {
             $value = 'href' === $attr ? esc_url($value) : esc_attr($value);
             $attributes .= ' ' . $attr . '="' . $value . '"';
         }
     }
     $item_output = $args->before;
     $item_output .= '<a' . $attributes . '>';
     $item_output .= $args->link_before . apply_filters('the_title', $item->title, $item->ID) . $args->link_after;
     $item_output .= '</a>';
     $item_output .= $args->after;
     $output .= apply_filters('walker_nav_menu_start_el', $item_output, $item, $depth, $args);
 }
开发者ID:andrewcroce,项目名称:TPL,代码行数:35,代码来源:offcanvas-walker.class.php


示例2: cherry_plugin_settings

 function cherry_plugin_settings()
 {
     global $wpdb;
     if (!function_exists('get_plugin_data')) {
         require_once ABSPATH . 'wp-admin/includes/plugin.php';
     }
     $upload_dir = wp_upload_dir();
     $plugin_data = get_plugin_data(plugin_dir_path(__FILE__) . 'cherry-plugin.php');
     //Cherry plugin constant variables
     define('CHERRY_PLUGIN_DIR', plugin_dir_path(__FILE__));
     define('CHERRY_PLUGIN_URL', plugin_dir_url(__FILE__));
     define('CHERRY_PLUGIN_DOMAIN', $plugin_data['TextDomain']);
     define('CHERRY_PLUGIN_DOMAIN_DIR', $plugin_data['DomainPath']);
     define('CHERRY_PLUGIN_VERSION', $plugin_data['Version']);
     define('CHERRY_PLUGIN_NAME', $plugin_data['Name']);
     define('CHERRY_PLUGIN_SLUG', plugin_basename(__FILE__));
     define('CHERRY_PLUGIN_DB', $wpdb->prefix . CHERRY_PLUGIN_DOMAIN);
     define('CHERRY_PLUGIN_REMOTE_SERVER', esc_url('http://tmbhtest.com/cherryframework.com/components_update/'));
     //Other constant variables
     define('CURRENT_THEME_DIR', get_stylesheet_directory());
     define('CURRENT_THEME_URI', get_stylesheet_directory_uri());
     define('UPLOAD_BASE_DIR', str_replace("\\", "/", $upload_dir['basedir']));
     define('UPLOAD_DIR', str_replace("\\", "/", $upload_dir['path'] . '/'));
     // if ( !defined('API_URL') ) {
     // 	define( 'API_URL', esc_url( 'http://updates.cherry.template-help.com/cherrymoto/v3/api/' ) );
     // }
     load_plugin_textdomain(CHERRY_PLUGIN_DOMAIN, false, dirname(plugin_basename(__FILE__)) . '/' . CHERRY_PLUGIN_DOMAIN_DIR);
     do_action('cherry_plugin_settings');
 }
开发者ID:drupalninja,项目名称:schome_org,代码行数:29,代码来源:cherry-plugin.php


示例3: xfac_get_avatar

function xfac_get_avatar($avatar = '', $id_or_email, $size = 96, $default = '', $alt = '')
{
    if (is_numeric($id_or_email)) {
        $wpUserId = (int) $id_or_email;
    } elseif (is_string($id_or_email) && ($user = get_user_by('email', $id_or_email))) {
        $wpUserId = $user->ID;
    } elseif (is_object($id_or_email) && !empty($id_or_email->user_id)) {
        $wpUserId = (int) $id_or_email->user_id;
    }
    if (empty($wpUserId)) {
        // cannot figure out the user id...
        return $avatar;
    }
    $apiRecords = xfac_user_getRecordsByUserId($wpUserId);
    if (empty($apiRecords)) {
        // no api records
        return $avatar;
    }
    $apiRecord = reset($apiRecords);
    if (empty($apiRecord->profile['links']['avatar'])) {
        // no avatar?
        return $avatar;
    }
    $avatar = $apiRecord->profile['links']['avatar'];
    $size = (int) $size;
    if (empty($alt)) {
        $alt = get_the_author_meta('display_name', $wpUserId);
    }
    $author_class = is_author($wpUserId) ? ' current-author' : '';
    $avatar = "<img alt='" . esc_attr($alt) . "' src='" . esc_url($avatar) . "' class='avatar avatar-{$size}{$author_class} photo' height='{$size}' width='{$size}' />";
    return $avatar;
}
开发者ID:billyprice1,项目名称:bdApi,代码行数:32,代码来源:avatar.php


示例4: square_posted_on

 /**
  * Prints HTML with meta information for the current post-date/time and author.
  */
 function square_posted_on()
 {
     $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
     if (get_the_time('U') !== get_the_modified_time('U')) {
         $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
     }
     $time_string = sprintf($time_string, esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_attr(get_the_modified_date('c')), esc_html(get_the_modified_date()));
     $posted_on = sprintf(esc_html_x('%s', 'post date', 'square'), '<a href="' . esc_url(get_permalink()) . '" rel="bookmark">' . $time_string . '</a>');
     $byline = sprintf(esc_html_x('by %s', 'post author', 'square'), '<span class="author vcard"><a class="url fn n" href="' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '">' . esc_html(get_the_author()) . '</a></span>');
     $comment_count = get_comments_number();
     // get_comments_number returns only a numeric value
     if (comments_open()) {
         if ($comment_count == 0) {
             $comments = __('No Comments', 'square');
         } elseif ($comment_count > 1) {
             $comments = $comment_count . __(' Comments', 'square');
         } else {
             $comments = __('1 Comment', 'square');
         }
         $comment_link = '<a href="' . get_comments_link() . '">' . $comments . '</a>';
     } else {
         $comment_link = __(' Comment Closed', 'square');
     }
     echo '<span class="posted-on"><i class="fa fa-clock-o"></i>' . $posted_on . '</span><span class="byline"> ' . $byline . '</span><span class="comment-count"><i class="fa fa-comments-o"></i>' . $comment_link . "</span>";
     // WPCS: XSS OK.
 }
开发者ID:jgcopple,项目名称:drgaryschwantz,代码行数:29,代码来源:template-tags.php


示例5: widget

 /**
  * Displays the widget contents.
  */
 public function widget($args, $instance)
 {
     extract($args);
     $title = apply_filters('widget_title', $instance['title']);
     echo $args['before_widget'];
     if (!empty($title)) {
         echo $args['before_title'] . $title . $args['after_title'];
     }
     $photos = $this->get_photos(array('username' => $instance['username'], 'count' => $instance['count'], 'tags' => $instance['tags']));
     if (is_wp_error($photos)) {
         echo $photos->get_error_message();
     } else {
         echo '<ul>';
         foreach ($photos as $photo) {
             $link = esc_url($photo->link);
             $src = esc_url($photo->media->m);
             $title = esc_attr($photo->title);
             $item = sprintf('<a href="%s"><img src="%s" alt="%s" /></a>', $link, $src, $title);
             $item = sprintf('<li>%s</li>', $item);
             echo $item;
         }
         echo '</ul>';
     }
     echo $args['after_widget'];
 }
开发者ID:SIB-Colombia,项目名称:biodiversidad_wp,代码行数:28,代码来源:flickr-widget.php


示例6: gdlr_print_hotel_availability_item

 function gdlr_print_hotel_availability_item($settings = array())
 {
     $item_id = empty($settings['page-item-id']) ? '' : ' id="' . $settings['page-item-id'] . '" ';
     global $gdlr_spaces, $hotel_option;
     $margin = !empty($settings['margin-bottom']) && $settings['margin-bottom'] != $gdlr_spaces['bottom-blog-item'] ? 'margin-bottom: ' . $settings['margin-bottom'] . ';' : '';
     $margin_style = !empty($margin) ? ' style="' . $margin . '" ' : '';
     $current_date = current_time('Y-m-d');
     $next_date = date('Y-m-d', strtotime($current_date . "+1 days"));
     $value = array('gdlr-check-in' => $current_date, 'gdlr-night' => 1, 'gdlr-check-out' => $next_date, 'gdlr-room-number' => 1, 'gdlr-adult-number' => 1, 'gdlr-children-number' => 0);
     $ret = gdlr_get_item_title($settings);
     $ret .= '<div class="gdlr-hotel-availability-wrapper';
     if (!empty($hotel_option['enable-hotel-branch']) && $hotel_option['enable-hotel-branch'] == 'enable') {
         $ret .= ' gdlr-hotel-branches-enable';
     }
     $ret .= '" ' . $margin_style . $item_id . ' >';
     $ret .= '<form class="gdlr-hotel-availability gdlr-item" id="gdlr-hotel-availability" method="post" action="' . esc_url(add_query_arg(array($hotel_option['booking-slug'] => ''), home_url('/'))) . '" >';
     if (!empty($hotel_option['enable-hotel-branch']) && $hotel_option['enable-hotel-branch'] == 'enable') {
         $ret .= gdlr_get_reservation_branch_combobox(array('title' => __('Hotel Branches', 'gdlr-hotel'), 'slug' => 'gdlr-hotel-branches', 'id' => 'gdlr-hotel-branches', 'value' => ''));
     }
     $ret .= gdlr_get_reservation_datepicker(array('title' => __('Check In', 'gdlr-hotel'), 'slug' => 'gdlr-check-in', 'id' => 'gdlr-check-in', 'value' => $value['gdlr-check-in']));
     $ret .= gdlr_get_reservation_combobox(array('title' => __('Night', 'gdlr-hotel'), 'slug' => 'gdlr-night', 'id' => 'gdlr-night', 'value' => $value['gdlr-night']));
     $ret .= gdlr_get_reservation_datepicker(array('title' => __('Check Out', 'gdlr-hotel'), 'slug' => 'gdlr-check-out', 'id' => 'gdlr-check-out', 'value' => $value['gdlr-check-out']));
     $ret .= gdlr_get_reservation_combobox(array('title' => __('Adults', 'gdlr-hotel'), 'slug' => 'gdlr-adult-number', 'id' => '', 'value' => $value['gdlr-adult-number'], 'multiple' => true));
     $ret .= gdlr_get_reservation_combobox(array('title' => __('Children', 'gdlr-hotel'), 'slug' => 'gdlr-children-number', 'id' => '', 'value' => $value['gdlr-children-number'], 'multiple' => true));
     $ret .= '<div class="gdlr-hotel-availability-submit" >';
     $ret .= '<input type="hidden" name="hotel_data" value="1" >';
     $ret .= '<input type="hidden" name="gdlr-room-number" value="1" />';
     $ret .= '<input type="submit" class="gdlr-reservation-bar-button gdlr-button with-border" value="' . __('Check Availability', 'gdlr-hotel') . '" >';
     $ret .= '</div>';
     $ret .= '<div class="clear"></div>';
     $ret .= '</form>';
     $ret .= '</div>';
     return $ret;
 }
开发者ID:konstantin-pr,项目名称:ses215,代码行数:34,代码来源:page-builder-sync.php


示例7: aaron_highlights

function aaron_highlights()
{
    /* 
    * Frontpage Highlights
    */
    if (get_theme_mod('aaron_hide_highlight') == "") {
        for ($i = 1; $i < 10; $i++) {
            if (get_theme_mod('aaron_highlight' . $i . '_headline') or get_theme_mod('aaron_highlight' . $i . '_text') or get_theme_mod('aaron_highlight' . $i . '_icon') and get_theme_mod('aaron_highlight' . $i . '_icon') != "no-icon" or get_theme_mod('aaron_highlight' . $i . '_image')) {
                echo '<div class="highlights" style="background:' . get_theme_mod('aaron_highlight' . $i . '_bgcolor', '#fafafa') . ';">';
                if (get_theme_mod('aaron_highlight' . $i . '_icon') != "" and get_theme_mod('aaron_highlight' . $i . '_icon') != "no-icon" and get_theme_mod('aaron_highlight' . $i . '_image') == "") {
                    echo '<i aria-hidden="true" class="dashicons ' . esc_attr(get_theme_mod('aaron_highlight' . $i . '_icon')) . '"  style="color:' . get_theme_mod('aaron_highlight' . $i . '_textcolor', '#333333') . ';"></i>';
                }
                if (get_theme_mod('aaron_highlight' . $i . '_image') != "") {
                    echo '<img src="' . esc_url(get_theme_mod('aaron_highlight' . $i . '_image')) . '">';
                }
                if (get_theme_mod('aaron_highlight' . $i . '_link') != "") {
                    echo '<a href="' . esc_url(get_theme_mod('aaron_highlight' . $i . '_link')) . '">';
                }
                if (get_theme_mod('aaron_highlight' . $i . '_headline') != "") {
                    echo '<h2 style="color:' . get_theme_mod('aaron_highlight' . $i . '_textcolor', '#333333') . ';">' . esc_html(get_theme_mod('aaron_highlight' . $i . '_headline')) . '</h2>';
                }
                if (get_theme_mod('aaron_highlight' . $i . '_text') != "") {
                    echo '<p style="color:' . get_theme_mod('aaron_highlight' . $i . '_textcolor', '#333333') . ';">' . esc_html(get_theme_mod('aaron_highlight' . $i . '_text')) . '</p>';
                }
                if (get_theme_mod('aaron_highlight' . $i . '_link') != "") {
                    echo '</a>';
                }
                echo '</div>';
            }
        }
    }
}
开发者ID:samfu1994,项目名称:personalWeb,代码行数:32,代码来源:highlights.php


示例8: hybrid_excerpt_more

/**
 * Filters the excerpt more output with internationalized text and a link to the post.
 *
 * @since  2.0.0
 * @access public
 * @param  string  $text
 * @return string
 */
function hybrid_excerpt_more($text)
{
    if (0 !== strpos($text, '<a')) {
        $text = sprintf(' <a href="%s" class="more-link">%s</a>', esc_url(get_permalink()), trim($text));
    }
    return $text;
}
开发者ID:KL-Kim,项目名称:my-theme,代码行数:15,代码来源:functions-filters.php


示例9: latex_render

function latex_render($latex, $fg, $bg, $s = 0)
{
    $url = "//s0.wp.com/latex.php?latex=" . urlencode($latex) . "&bg=" . $bg . "&fg=" . $fg . "&s=" . $s;
    $url = esc_url($url);
    $alt = str_replace('\\', '&#92;', esc_attr($latex));
    return '<img src="' . $url . '" alt="' . $alt . '" title="' . $alt . '" class="latex" />';
}
开发者ID:briancompton,项目名称:knightsplaza,代码行数:7,代码来源:latex.php


示例10: widget

    function widget($args, $instance)
    {
        extract($args);
        $title = empty($instance['title']) ? '' : strip_tags($instance['title']);
        echo $before_widget;
        if (!empty($title)) {
            echo $before_title . $title . $after_title;
        }
        if (dt_theme_option('general', 'show-sociables')) {
            ?>
					<ul class="dt-sc-social-icons"><?php 
            $socials = dt_theme_option('social');
            if ($socials != null) {
                foreach ($socials as $social) {
                    $link = esc_url($social['link']);
                    $icon = esc_attr($social['icon']);
                    echo "<li class='" . substr($icon, 3) . "'>";
                    echo "<a class='fa {$icon}' href='{$link}'></a>";
                    echo "</li>";
                }
            } else {
                echo "<div class='error message'><span class='icon'></span>" . __('Please add social icons in general settings.', 'iamd_text_domain') . "</div>";
            }
            ?>
					</ul><?php 
        } else {
            echo "<div class='error message'><span class='icon'></span>" . __('Please enable social icons in general settings.', 'iamd_text_domain') . "</div>";
        }
        echo $after_widget;
    }
开发者ID:h3rodev,项目名称:sometheme,代码行数:30,代码来源:social_widget.php


示例11: remote_viewing_section

    /**
     * Renders Remote Viewing portion of Plugin Settings Page
     *
     * @since 1.0
     *
     * @return void
     */
    static function remote_viewing_section()
    {
        $value = get_option('simple_system_status_remote_url');
        $url = home_url() . '/?simple_system_status=' . $value;
        ?>
		<p><?php 
        _e('Users with this URL can view a plain-text version of your System Status.<br />This link can be handy in support forums, as access to this information can be removed after you receive the help you need.<br />Generating a new URL will safely void access to all who have the existing URL.', WC_QD_TXT);
        ?>
</p>
		<p><input type="text" readonly="readonly" class="sss-url sss-url-text" onclick="this.focus();this.select()" value="<?php 
        echo esc_url($url);
        ?>
" title="<?php 
        _e('To copy the System Status, click below then press Ctrl + C (PC) or Cmd + C (Mac).', WC_QD_TXT);
        ?>
" />&nbsp;&nbsp;<a href="<?php 
        echo esc_url($url);
        ?>
" target="_blank" class="sss-tiny sss-url-text-link"><?php 
        _e('test url', WC_QD_TXT);
        ?>
</a></p>
		<p class="submit">
			<input type="submit" onClick="return false;" class="button-secondary" name="generate-new-url" value="<?php 
        _e('Generate New URL', WC_QD_TXT);
        ?>
" />
		</p>
		<?php 
    }
开发者ID:bestmazzo,项目名称:woocomerce-quick-donation,代码行数:37,代码来源:viewer.php


示例12: lp_thumbnail_metabox

function lp_thumbnail_metabox()
{
    global $post;
    $template = get_post_meta($post->ID, 'lp-selected-template', true);
    $template = apply_filters('lp_selected_template', $template);
    $permalink = get_permalink($post->ID);
    $datetime = the_modified_date('YmjH', null, null, false);
    $permalink = $permalink . '?dt=' . $datetime;
    if (in_array($_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1'))) {
        if (file_exists(LANDINGPAGES_UPLOADS_PATH . $template . '/thumbnail.png')) {
            $thumbnail = LANDINGPAGES_UPLOADS_URLPATH . $template . '/thumbnail.png';
        } else {
            $thumbnail = LANDINGPAGES_URLPATH . 'templates/' . $template . '/thumbnail.png';
        }
    } else {
        $thumbnail = 'http://s.wordpress.com/mshots/v1/' . urlencode(esc_url($permalink)) . '?w=250';
    }
    $permalink = apply_filters('lp_live_screenshot_url', $permalink);
    ?>
	<div >
		<div class="inside" style='margin-left:-8px;'>
			<table>
				<tr>
					<td>
						<?php 
    echo "<a href='{$permalink}' target='_blank' ><img src='{$thumbnail}' style='width:250px;height:250px;' title='" . __('Preview this theme', 'landing-pages') . " ,  ({$template})'></a>";
    ?>
					</td>
				</tr>
			</table>

		</div>
	</div>
	<?php 
}
开发者ID:m-godefroid76,项目名称:devrestofactory,代码行数:35,代码来源:module.metaboxes.php


示例13: ebor_call_to_action_block_shortcode

/**
 * The Shortcode
 */
function ebor_call_to_action_block_shortcode($atts, $content = null)
{
    extract(shortcode_atts(array('title' => '', 'url' => '', 'button_text' => '', 'target' => '_blank'), $atts));
    $output = '
		<div class="cta-text-basic row">
			<div class="container-fluid">
				<div class="row">
					<div class="col-sm-12">
						<hr>
					</div>
				</div><!--end of row-->
				<div class="row">
					<div class="col-md-9 col-sm-8">
						<h3>' . $title . '</h3>
					</div>
					<div class="col-md-3 col-sm-4 text-right text-left-xs">
						<a href="' . esc_url($url) . '" class="btn" target="' . esc_attr($target) . '">
							<span class="btn__text">
								' . $button_text . '
							</span>
							<i class="ion-arrow-right-c"></i>
						</a>
					</div>
				</div><!--end of row-->
			</div><!--end of container-->
		</div>
	';
    return $output;
}
开发者ID:tommusrhodus,项目名称:Ebor-Framework,代码行数:32,代码来源:vc_cta_block.php


示例14: wen_business_custom_customize_enqueue_scripts

function wen_business_custom_customize_enqueue_scripts()
{
    wp_register_script('wen_business_customizer_button', get_template_directory_uri() . '/assets/js/customizer-button.js', array('customize-controls'), '20130508', true);
    $data = array('updrade_button_text' => __('Upgrade To Pro', 'wen-business'), 'updrade_button_link' => esc_url('http://catchthemes.com/themes/wen-business-pro'));
    wp_localize_script('wen_business_customizer_button', 'WEN_Business_Customizer_Object', $data);
    wp_enqueue_script('wen_business_customizer_button');
}
开发者ID:suskr50,项目名称:sc-profile,代码行数:7,代码来源:customizer.php


示例15: get_archives_link

 /**
  * @internal
  * @param string $url
  * @param string $text
  * @return mixed
  */
 protected function get_archives_link($url, $text)
 {
     $ret = array();
     $ret['text'] = $ret['title'] = $ret['name'] = wptexturize($text);
     $ret['url'] = $ret['link'] = esc_url(TimberURLHelper::prepend_to_url($url, $this->base));
     return $ret;
 }
开发者ID:sdunham,项目名称:sustainable,代码行数:13,代码来源:timber-archives.php


示例16: x_shortcode_toc_item

function x_shortcode_toc_item($atts)
{
    extract(shortcode_atts(array('id' => '', 'class' => '', 'style' => '', 'title' => '', 'page' => ''), $atts, 'x_toc_item'));
    $id = $id != '' ? 'id="' . esc_attr($id) . '"' : '';
    $class = $class != '' ? 'x-toc-item ' . esc_attr($class) : 'x-toc-item';
    $style = $style != '' ? 'style="' . $style . '"' : '';
    $title = $title != '' ? $title : '';
    switch ($page) {
        case 0:
            $page = '';
            break;
        case 1:
            $page = '';
            break;
        default:
            $page = $page;
            if (get_post_status(get_the_ID()) == "draft") {
                $page = '&page=' . $page;
            } else {
                $page = get_the_ID() == get_option('page_on_front') ? 'page/' . $page . '/' : $page . '/';
            }
    }
    $link = esc_url(get_permalink());
    $output = "<li {$id} class=\"{$class}\" {$style}><a href=" . $link . $page . " title=\"Go to {$title}\">" . $title . '</a></li>';
    return $output;
}
开发者ID:elinberg,项目名称:ericlinberg,代码行数:26,代码来源:toc.php


示例17: twentyfourteen_contextual_help

/**
 * Add contextual help to the Themes and Post edit screens.
 *
 * @since Twenty Fourteen 1.0
 */
function twentyfourteen_contextual_help()
{
    if ('admin_head-edit.php' === current_filter() && 'post' !== $GLOBALS['typenow']) {
        return;
    }
    get_current_screen()->add_help_tab(array('id' => 'twentyfourteen', 'title' => __('Twenty Fourteen', 'twentyfourteen'), 'content' => '<ul>' . '<li>' . sprintf(__('The home page features your choice of up to 6 posts prominently displayed in a grid or slider, controlled by a <a href="%1$s">tag</a>; you can change the tag and layout in <a href="%2$s">Appearance &rarr; Customize</a>. If no posts match the tag, <a href="%3$s">sticky posts</a> will be displayed instead.', 'twentyfourteen'), esc_url(add_query_arg('tag', _x('featured', 'featured content default tag slug', 'twentyfourteen'), admin_url('edit.php'))), admin_url('customize.php'), admin_url('edit.php?show_sticky=1')) . '</li>' . '<li>' . sprintf(__('Enhance your site design by using <a href="%s">Featured Images</a> for posts you&rsquo;d like to stand out (also known as post thumbnails). This allows you to associate an image with your post without inserting it. Twenty Fourteen uses featured images for posts and pages&mdash;above the title&mdash;and in the Featured Content area on the home page.', 'twentyfourteen'), 'https://codex.wordpress.org/Post_Thumbnails#Setting_a_Post_Thumbnail') . '</li>' . '<li>' . sprintf(__('For an in-depth tutorial, and more tips and tricks, visit the <a href="%s">Twenty Fourteen documentation</a>.', 'twentyfourteen'), 'https://codex.wordpress.org/Twenty_Fourteen') . '</li>' . '</ul>'));
}
开发者ID:harrisonsmith,项目名称:active-progression,代码行数:12,代码来源:customizer.php


示例18: widget

    function widget($args, $instance)
    {
        extract($args);
        $rss = fetch_feed('http://feeds.feedburner.com/INNMemberInvestigations');
        $title = __('Stories From Other INN Members', 'largo');
        $desc = __('View more recent stories from members of INN', 'largo');
        $link = 'http://inn.org/network-content';
        $title = "<a class='rsswidget' href='{$link}' title='{$desc}'>{$title}</a>";
        $title = apply_filters('widget_title', empty($instance['title']) ? __('Stories From Other INN Members', 'largo') : $instance['title'], $instance, $this->id_base);
        echo $before_widget;
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        largo_widget_rss_output($rss, $instance);
        ?>

		<p class="morelink"><a href="<?php 
        echo esc_url($link);
        ?>
"><?php 
        _e('More Stories From INN Members', 'largo');
        ?>
&nbsp;&raquo;</a></p>

		<?php 
        echo $after_widget;
        unset($rss);
    }
开发者ID:NathanLawrence,项目名称:Largo,代码行数:28,代码来源:largo-inn-rss.php


示例19: render

 /**
  * Render the shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render($args, $content = '')
 {
     $defaults = Magee_Core::set_shortcode_defaults(array('url' => '', 'number' => 3, 'class' => '', 'id' => ''), $args);
     extract($defaults);
     self::$args = $defaults;
     $html = '';
     //$html = '<h2>'._e( 'Recent news from Some-Other Blog:', 'my-text-domain' ).'<h2>';
     if ($url !== '') {
         include_once ABSPATH . WPINC . '/feed.php';
         $rss = fetch_feed(esc_url($url));
         $maxitems = 0;
         if (!is_wp_error($rss)) {
             $maxitems = $rss->get_item_quantity(esc_attr($number));
             $rss_items = $rss->get_items(0, $maxitems);
         }
         $html = '<ul class="' . esc_attr($class) . '" id="' . esc_attr($id) . '">';
         if ($maxitems == 0) {
             $html .= '<li>' . _e('No items', 'magee-shortcodes') . '</li>';
         } else {
             foreach ($rss_items as $item) {
                 $html .= '<li>';
                 $html .= '<a target="_blank" href="' . esc_url($item->get_permalink()) . '" ';
                 $html .= 'title="' . __('Posted ' . $item->get_date('j F Y | g:i a'), 'magee-shortcodes') . '">';
                 $html .= $item->get_title();
                 $html .= '</a>';
                 $html .= '</li>';
             }
         }
         $html .= '</ul>';
     }
     return $html;
 }
开发者ID:JasonAJames,项目名称:jasonajamescom,代码行数:38,代码来源:class-rss-feed.php


示例20: widget

    function widget($args, $instance)
    {
        $settings = $this->woo_get_settings();
        extract($args, EXTR_SKIP);
        $instance = wp_parse_args($instance, $settings);
        extract($instance, EXTR_SKIP);
        echo '<div class="adspace-widget widget">';
        if ($title != '') {
            echo $before_title . apply_filters('widget_title', $title, $instance, $this->id_base) . $after_title;
        }
        if ($adcode != '') {
            echo $adcode;
        } else {
            ?>
<a href="<?php 
            echo esc_url($href);
            ?>
"><img src="<?php 
            echo apply_filters('widget_title', $title, $instance, $this->id_base);
            ?>
" alt="<?php 
            echo esc_attr($alt);
            ?>
" /></a><?php 
        }
        echo '</div>';
    }
开发者ID:ericvyc,项目名称:mtp,代码行数:27,代码来源:widget-woo-adspace.php



注:本文中的esc_url函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP esc_url_raw函数代码示例发布时间:2022-05-15
下一篇:
PHP esc_textarea函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap