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

PHP esc_html_x函数代码示例

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

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



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

示例1: 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


示例2: impronta_metadata

 /**
  * Prints HTML with meta information for the current post-date/time and author.
  */
 function impronta_metadata()
 {
     // Hide category and tag text for pages.
     if ('post' === get_post_type()) {
         echo '<p class="metadata">';
         $byline = sprintf(esc_html_x('By %s', 'post author', 'impronta'), '<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> ');
         echo $byline;
         /* translators: used between list items, there is a space after the comma */
         $categories_list = get_the_category_list(esc_html__(', ', 'impronta'));
         if ($categories_list && impronta_categorized_blog()) {
             printf('<span class="cat-links">' . esc_html_x('on %1$s ', 'on categories', 'impronta') . '</span>', $categories_list);
             // WPCS: XSS OK.
         }
         /* translators: used between list items, there is a space after the comma */
         $tags_list = get_the_tag_list('', esc_html__(', ', 'impronta'));
         if ($tags_list) {
             printf(esc_html__('tagged %1$s', 'impronta'), $tags_list);
             // WPCS: XSS OK.
         }
         if (!is_single() && !post_password_required() && (comments_open() || get_comments_number())) {
             if (get_comments_number(get_the_id()) == 0) {
                 echo esc_html__('- ', 'impronta');
             } else {
                 echo esc_html__('with ', 'impronta');
             }
             comments_popup_link(esc_html__('Leave a comment', 'impronta'), esc_html__('1 Comment', 'impronta'), esc_html__('% Comments', 'impronta'));
         }
         if (is_sticky()) {
             echo ' - ' . '<i class="feature-star fa fa-star" data-toggle="tooltip" data-placement="right" title="' . esc_attr__('Featured Post', 'impronta') . '"></i>';
         }
         echo '</p>';
     }
 }
开发者ID:nicoandrade,项目名称:Impronta,代码行数:36,代码来源:template-tags.php


示例3: ushipnetwork_entry_footer

 /**
  * Prints HTML with meta information for the categories, tags and comments.
  */
 function ushipnetwork_entry_footer()
 {
     // Hide category and tag text for pages.
     if ('post' === get_post_type()) {
         $byline = sprintf(esc_html_x('by %s', 'post author', 'ushipnetwork'), '<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>');
         echo '<div class="byline">' . '<div class="authorship">' . $byline . '</div>' . '<div class="share">';
         include "share.php";
         echo '</div>' . '</div>';
         $posttags = get_the_tags();
         $count = 0;
         $separator = ', ';
         $output = '';
         if (!empty($posttags)) {
             echo '<span class="tag-list">tags: ';
             foreach ($posttags as $posttag) {
                 $count++;
                 if ($count <= 2) {
                     $output .= '<a href="' . esc_url(get_tag_link($posttag->term_id)) . '" alt="' . esc_attr(sprintf(__('View all posts in %s', 'textdomain'), $posttag->name)) . '">' . esc_html($posttag->name) . '</a>' . $separator;
                 }
             }
             echo trim($output, $separator);
         }
         echo '</span>';
     }
     edit_post_link(sprintf(esc_html__('Edit %s', 'ushipnetwork'), the_title('<span class="screen-reader-text">"', '"</span>', false)), '<span class="edit-link">', '</span>');
 }
开发者ID:rmikeska,项目名称:ushipnetwork,代码行数:29,代码来源:template-tags.php


示例4: vaidusworld_register_sidebars

/**
 * Registers sidebars.
 *
 * @since  1.0.0
 * @access public
 * @return void
 */
function vaidusworld_register_sidebars()
{
    hybrid_register_sidebar(array('id' => 'primary', 'name' => esc_html_x('Primary', 'sidebar', 'vaidusworld'), 'description' => esc_html__('Add sidebar description.', 'vaidusworld')));
    // hybrid_register_sidebar(
    // 	array(
    // 		'id'          => 'header-right',
    // 		'name'        => esc_html_x( 'Header Right', 'sidebar', 'vaidusworld' ),
    // 		'description' => esc_html__( 'Add sidebar description.', 'vaidusworld' )
    // 	)
    // );
    //
    // hybrid_register_sidebar(
    // 	array(
    // 		'id'          => 'footer-1',
    // 		'name'        => esc_html_x( 'Footer 1', 'sidebar', 'vaidusworld' ),
    // 		'description' => esc_html__( 'Add sidebar description.', 'vaidusworld' )
    // 	)
    // );
    //
    // hybrid_register_sidebar(
    // 	array(
    // 		'id'          => 'footer-2',
    // 		'name'        => esc_html_x( 'Footer 2', 'sidebar', 'vaidusworld' ),
    // 		'description' => esc_html__( 'Add sidebar description.', 'vaidusworld' )
    // 	)
    // );
    //
    // hybrid_register_sidebar(
    // 	array(
    // 		'id'          => 'footer-3',
    // 		'name'        => esc_html_x( 'Footer 3', 'sidebar', 'vaidusworld' ),
    // 		'description' => esc_html__( 'Add sidebar description.', 'vaidusworld' )
    // 	)
    // );
}
开发者ID:grvrulz,项目名称:vaidusworld,代码行数:42,代码来源:theme.php


示例5: ubuntugnome_register_sidebars

/**
 * Registers sidebars.
 *
 * @since  1.0.0
 * @access public
 * @return void
 */
function ubuntugnome_register_sidebars()
{
    hybrid_register_sidebar(array('id' => 'footer-1', 'name' => esc_html_x('Footer 1', 'sidebar', 'magik'), 'description' => esc_html__('Add sidebar description.', 'magik')));
    hybrid_register_sidebar(array('id' => 'footer-2', 'name' => esc_html_x('Footer 2', 'sidebar', 'magik'), 'description' => esc_html__('Add sidebar description.', 'magik')));
    hybrid_register_sidebar(array('id' => 'footer-3', 'name' => esc_html_x('Footer 3', 'sidebar', 'magik'), 'description' => esc_html__('Add sidebar description.', 'magik')));
    hybrid_register_sidebar(array('id' => 'footer-4', 'name' => esc_html_x('Footer 4', 'sidebar', 'magik'), 'description' => esc_html__('Add sidebar description.', 'magik')));
}
开发者ID:UbuntuGNOMEMarketing,项目名称:ubuntugnome,代码行数:14,代码来源:theme.php


示例6: output_html

 /**
  * Modify the output of the field on the fronted profile.
  *
  * @since 1.2.0
  * @param  string $value the value of the field.
  * @param  object $field field details.
  * @return string        the formatted field value.
  */
 public static function output_html($value, $field)
 {
     if ($value == '1') {
         $value = esc_html_x('Yes', 'Used when displaying the value of a checkbox field within the profile page.', 'wpaam');
     }
     return $value;
 }
开发者ID:devd123,项目名称:wpaam,代码行数:15,代码来源:checkbox.php


示例7: river_radio_posted_on

    /**
     * Prints HTML with meta information for the current post-date/time and author.
     */
    function river_radio_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', 'river-radio'), '<a href="' . esc_url(get_permalink()) . '" rel="bookmark">' . $time_string . '</a>');
        $byline = sprintf(esc_html_x('%s', 'post author', 'river-radio'), '<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>');
        echo '<span class="byline icons"><i class="fa fa-headphones"></i>
 ' . $byline . '</span><span class="posted-on icons"><i class="fa fa-calendar"></i>
' . $posted_on . '</span>';
        // WPCS: XSS OK.
        if ('post' === get_post_type()) {
            $tags_list = get_the_tag_list('', esc_html__(', ', 'river-radio'));
            if ($tags_list) {
                printf('<span class="tags-links icons"><i class="fa fa-music"></i>
' . esc_html__('%1$s', 'river-radio') . '</span>  ', $tags_list);
                // WPCS: XSS OK.
            }
            $categories_list = get_the_category_list(esc_html__(', ', 'river-radio'));
            if ($categories_list && river_radio_categorized_blog()) {
                printf('<span class="cat-links icons"><i class="fa fa-map-marker"></i>
' . esc_html__('%1$s', 'river-radio') . '</span>', $categories_list);
                // WPCS: XSS OK.
            }
        }
    }
开发者ID:AndyA,项目名称:River,代码行数:31,代码来源:template-tags.php


示例8: ocin_lite_metadata

 /**
  * Prints HTML with meta information for the current post-date/time and author.
  */
 function ocin_lite_metadata()
 {
     echo '<ul>';
     $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()));
     echo '<li class="meta_date">' . $time_string . '</li>';
     $byline = sprintf(esc_html_x('by %s', 'post author', 'ocin-lite'), '<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>');
     echo '<li class="meta_comments">' . $byline . '</li>';
     if (!is_single() && !post_password_required() && (comments_open() || get_comments_number())) {
         echo '<li class="meta_date"><span class="comments-link">';
         comments_popup_link(esc_html__('Leave a comment', 'ocin-lite'), esc_html__('1 Comment', 'ocin-lite'), esc_html__('% Comments', 'ocin-lite'));
         echo '</span></li>';
     }
     // Hide category and tag text for pages.
     if ('post' === get_post_type() && is_single()) {
         /* translators: used between list items, there is a space after the comma */
         $categories_list = get_the_category_list(esc_html__(', ', 'ocin-lite'));
         if ($categories_list && ocin_lite_categorized_blog()) {
             printf('<li class="meta_categories"><span class="cat-links">' . esc_html__('Posted in %1$s', 'ocin-lite') . '</span></li>', $categories_list);
             // WPCS: XSS OK.
         }
         /* translators: used between list items, there is a space after the comma */
         $tags_list = get_the_tag_list('', esc_html__(', ', 'ocin-lite'));
         if ($tags_list) {
             printf('<li class="meta_tags"><span class="tags-links">' . esc_html__('Tagged %1$s', 'ocin-lite') . '</span></li>', $tags_list);
             // WPCS: XSS OK.
         }
     }
     echo '</ul>';
 }
开发者ID:nicoandrade,项目名称:Ocin-Lite,代码行数:36,代码来源:template-tags.php


示例9: add

 /**
  * Adds the settings page to the Settings menu.
  *
  * @wp-hook admin_menu
  *
  * @return void
  */
 public function add()
 {
     $menu_title = esc_html_x('Taxonomies', 'Menu item title', 'linked-taxonomies');
     $capability = $this->settings_page->get_capability('list');
     $menu_slug = $this->settings_page->get_slug();
     add_options_page($this->title, $menu_title, $capability, $menu_slug, array($this, 'render'));
 }
开发者ID:tfrommen,项目名称:linked-taxonomies,代码行数:14,代码来源:View.php


示例10: display_template_management_view

    /**
     * Display Template List Table
     */
    public static function display_template_management_view()
    {
        self::run_management_actions();
        echo '<div class="wrap">';
        ?>

        <h2><?php 
        _e('Manage Templates', 'landing-pages');
        ?>
            <a href="edit.php?post_type=landing-page&page=lp_templates_upload"
               class="add-new-h2"><?php 
        echo esc_html_x('Add New Template', 'template');
        ?>
</a>
        </h2>
        <?php 
        $myListTable = new Landing_Pages_Templates_List_Table();
        $myListTable->prepare_items();
        ?>
        <form method="post">
            <input type="hidden" name="page" value="my_list_test"/>
            <?php 
        $myListTable->search_box('search', 'search_id');
        ?>
        </form>
        <form method="post" id='bulk_actions'>

        <?php 
        $myListTable->display();
        echo '</div></form>';
    }
开发者ID:alekseivillegas,项目名称:landing-pages,代码行数:34,代码来源:class.template-management.php


示例11: jkl_index_posted_on

 /**
  * Prints HTML with meta information for the current post-date/time and author.
  */
 function jkl_index_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()));
     $byline = sprintf(esc_html('%s'), '<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>');
     if ('chat' === get_post_format() || 'image' === get_post_format() || 'gallery' === get_post_format() || 'audio' === get_post_format() || 'video' === get_post_format()) {
         $string = ucwords(get_post_format());
         $posted_on = $string . ': <a href="' . esc_url(get_permalink()) . '" rel="bookmark">' . $time_string . '</a>';
     } else {
         $posted_on = sprintf(esc_html_x('Date: %s', 'post date', 'jkl'), '<a href="' . esc_url(get_permalink()) . '" rel="bookmark">' . $time_string . '</a>');
     }
     $meta_class = is_single() ? 'format-small-meta' : 'meta-content-index';
     echo '<div class="' . $meta_class . '">';
     echo '<span class="posted-on">' . $posted_on . '</span>';
     // WPCS: XSS OK.
     if (is_single()) {
         echo '<span class="byline">' . $byline . '</span>';
         if (!has_post_format('quote')) {
             jkl_better_taxonomy_listing('category', 1);
         }
     }
     echo '</div><!-- .meta-content-index -->';
 }
开发者ID:jekkilekki,项目名称:theme-jkl,代码行数:29,代码来源:template-tags.php


示例12: pleiadesweb_posted_on

 /**
  * Prints HTML with meta information for the current post-date/time and author.
  */
 function pleiadesweb_posted_on()
 {
     // 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('<i class="fa fa-calendar"></i>' . esc_html_x(' %s', 'post date', 'pleiadesweb'), '<a href="' . esc_url(get_permalink()) . '" rel="bookmark">' . $time_string . '</a>');
     // AUTHOR
     $byline = sprintf(esc_html_x('| escrito por %s', 'post author', 'pleiadesweb'), '<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>');
     echo '<span class="posted-on">' . $posted_on . '</span><span class="byline"> ' . $byline . '</span>';
     // CATEGORIES
     /* translators: used between list items, there is a space after the comma */
     $categories_list = get_the_category_list(esc_html__(', ', 'pleiadesweb'));
     if ($categories_list && pleiadesweb_categorized_blog()) {
         echo ' | </i><span class="category-list">' . $categories_list . '</span>';
     }
     // COMMENTS
     if (!post_password_required() && (comments_open() || '0' != get_comments_number())) {
         echo ' | <span class="comments-link">';
         comments_popup_link(__('Deja un comentario', 'my-simone'), __('1 comentario', 'my-simone'), __('% comentarios', 'my-simone'));
         echo '</span>';
     }
     //!post_password_required()
 }
开发者ID:pleiadesdigital,项目名称:pleiadesweb,代码行数:29,代码来源:template-tags.php


示例13: abc_nuorisotominta_posted_on

 /**
  * Prints HTML with meta information for the current post-date/time and author.
  */
 function abc_nuorisotominta_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', 'abc-nuorisotominta'), '<a href="' . esc_url(get_permalink()) . '" rel="bookmark">' . $time_string . '</a>');
     /*
     	$posted_on = sprintf(
     		esc_html_x( 'Posted on %s', 'post date', 'abc-nuorisotominta' ),
     		'<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>'
     	);
     */
     /*
     	$byline = sprintf(
     		esc_html_x( 'by %s', 'post author', 'abc-nuorisotominta' ),
     		'<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>'
     	);
     */
     echo '<span class="posted-on">' . $posted_on . '</span><span class="byline"> ' . $byline . '</span>';
     // WPCS: XSS OK.
 }
开发者ID:aleksandr-fishchenko,项目名称:abc-nuorisotoiminta-wordpress-theme,代码行数:28,代码来源:template-tags.php


示例14: magik_register_sidebars

/**
 * Registers sidebars.
 *
 * @since  1.0.0
 * @access public
 * @return void
 */
function magik_register_sidebars()
{
    hybrid_register_sidebar(array('id' => 'primary', 'name' => esc_html_x('Primary', 'sidebar', 'magik'), 'description' => esc_html__('Add sidebar description.', 'magik')));
    hybrid_register_sidebar(array('id' => 'footer-1', 'name' => esc_html_x('Footer 1', 'sidebar', 'magik'), 'description' => esc_html__('Add sidebar description.', 'magik')));
    hybrid_register_sidebar(array('id' => 'footer-2', 'name' => esc_html_x('Footer 2', 'sidebar', 'magik'), 'description' => esc_html__('Add sidebar description.', 'magik')));
    hybrid_register_sidebar(array('id' => 'footer-3', 'name' => esc_html_x('Footer 3', 'sidebar', 'magik'), 'description' => esc_html__('Add sidebar description.', 'magik')));
}
开发者ID:MagikPress,项目名称:magik,代码行数:14,代码来源:theme.php


示例15: usbasske_posted_on

 /**
  * Prints HTML with meta information for the current post-date/time and author.
  */
 function usbasske_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('Posted on %s', 'post date', 'usbasske'), '<a href="' . esc_url(get_permalink()) . '" rel="bookmark">' . $time_string . '</a>');
     $byline = sprintf(esc_html_x('by %s', 'post author', 'usbasske'), '<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>');
     // Display the author avatar if the author has a Gravatar
     $author_id = get_the_author_meta('ID');
     if (usbasske_validate_gravatar($author_id)) {
         echo '<div class="meta-content has-avatar">';
         echo '<div class="author-avatar">' . get_avatar($author_id) . '</div>';
     } else {
         echo '<div class="meta-content">';
     }
     echo '<span class="byline"> ' . $byline . '</span><span class="posted-on">' . $posted_on . '</span>';
     // WPCS: XSS OK.
     if (!post_password_required() && (comments_open() || get_comments_number())) {
         echo '<span class="comments-link">';
         comments_popup_link(esc_html__('Leave a comment', 'usbasske'), esc_html__('1 Comment', 'usbasske'), esc_html__('% Comments', 'usbasske'));
         echo '</span>';
     }
     echo '</div><!-- .meta-content -->';
 }
开发者ID:basskee,项目名称:bd-theme,代码行数:29,代码来源:template-tags.php


示例16: bemmy_posted_on

/**
 * Prints HTML with meta information for the current post-date/time and author.
 */
function bemmy_posted_on()
{
    $byline = sprintf(esc_html_x('%s', 'post author', 'bemmy'), '<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>');
    $posted_in = '';
    // Hide category and tag text for pages.
    if ('post' === get_post_type()) {
        /* translators: used between list items, there is a space after the comma */
        $tags_list = get_the_tag_list('', esc_html__(', ', 'bemmy'));
        if ($tags_list) {
            $posted_in .= sprintf(' on <span class="tags-links">' . esc_html__(' %1$s', 'bemmy') . '</span>', $tags_list);
            // WPCS: XSS OK.
        }
        /* translators: used between list items, there is a space after the comma */
        $categories_list = get_the_category_list(esc_html__(', ', 'bemmy'));
        if ($categories_list && bemmy_categorized_blog()) {
            $posted_in .= sprintf(' <span class="cat-links">' . esc_html__(' in %1$s', 'bemmy') . '</span>', $categories_list);
            // WPCS: XSS OK.
        }
    }
    echo '<span class="artcile__meta-byline"> ' . $byline . '</span><span class="article__meta-in">' . $posted_in . '</span>';
    // WPCS: XSS OK.
    $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('<span class="sep"> | </span>' . esc_html_x(' %s', 'post date', 'bemmy'), '<a href="' . esc_url(get_permalink()) . '" rel="bookmark">' . $time_string . '</a>');
    echo $posted_on;
}
开发者ID:gios-asu,项目名称:bemmy-wordpress-theme,代码行数:32,代码来源:Meta.php


示例17: munsa_lite_posted_on

 /**
  * Prints HTML with meta information for the current post-date/time and author.
  */
 function munsa_lite_posted_on()
 {
     // Set up entry date.
     printf('<span class="entry-date"><span class="screen-reader-text">%1$s </span><a href="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s" ' . hybrid_get_attr('entry-published') . '>%4$s</time></a></span>', esc_html_x('Posted on', 'Used before publish date.', 'munsa-lite'), esc_url(get_permalink()), esc_attr(get_the_date('c')), esc_html(get_the_date()));
     // Set up byline.
     printf('<span class="byline"><span class="entry-author" ' . hybrid_get_attr('entry-author') . '><span class="screen-reader-text">%1$s </span><a class="entry-author-link" href="%2$s" rel="author" itemprop="url"><span itemprop="name">%3$s</span></a></span></span>', esc_html_x('Author', 'Used before post author name.', 'munsa-lite'), esc_url(get_author_posts_url(get_the_author_meta('ID'))), get_the_author());
 }
开发者ID:samikeijonen,项目名称:munsa-lite,代码行数:10,代码来源:template-tags.php


示例18: i4_lms_posted_on

 /**
  * Prints HTML with meta information for the current post-date/time and author.
  */
 function i4_lms_posted_on()
 {
     $time_string = '<time class="announcement-posted-date published" datetime="%1$s">%2$s</time>';
     $time_string = sprintf($time_string, esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_attr(get_the_date('c')), esc_html(get_the_date()));
     $posted_on = sprintf(esc_html_x('%s', 'post date', 'i4web'), '<a href="' . esc_url(get_permalink()) . '" rel="bookmark">' . $time_string . '</a>');
     return $time_string;
     // WPCS: XSS OK.
 }
开发者ID:NeilToor,项目名称:i4web-lms,代码行数:11,代码来源:post-meta-functions.php


示例19: __construct

 public function __construct()
 {
     $widget_ops = array('classname' => 'barcelona-widget-slider-posts', 'description' => esc_html_x('Displays the specified posts as a slider', 'Slider Posts widget description', 'barcelona'));
     parent::__construct('barcelona-slider-posts', sprintf(esc_html_x('%s Slider Posts', 'Slider Posts widget name', 'barcelona'), BARCELONA_THEME_NAME), $widget_ops);
     add_action('save_post', array($this, 'flush_widget_cache'));
     add_action('deleted_post', array($this, 'flush_widget_cache'));
     add_action('switch_theme', array($this, 'flush_widget_cache'));
 }
开发者ID:yalmaa,项目名称:little-magazine,代码行数:8,代码来源:barcelona-slider-posts.php


示例20: load_scripts

 /**
  * Load JS scripts.
  */
 public function load_scripts()
 {
     $min = defined('SCRIPT_DEBUG') && true === SCRIPT_DEBUG ? '' : '.min';
     wp_enqueue_script('wpml_tm_translate_independently', WPML_TM_TRANSLATE_INDEPENDENTLY_URL . "/assets/js/wpml_tm_translate_independently{$min}.js", array('jquery'), WPML_TM_TRANSLATE_INDEPENDENTLY_VERSION);
     $message = esc_html_x('You are about to translate duplicated posts.', '1/2 Confirm to disconnect duplicates', 'sitepress') . "\n";
     $message .= esc_html_x('These items will be automatically disconnected from originals, so translation is not lost when you update the originals.', '2/2 Confirm to disconnect duplicates', 'sitepress');
     wp_localize_script('wpml_tm_translate_independently', 'wpml_tm_translate_independently', array('message' => $message));
 }
开发者ID:OnTheGoSystems,项目名称:WPML-TM-Translate-Independently,代码行数:11,代码来源:class-wpml-tm-translate-independently.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP esc_js函数代码示例发布时间:2022-05-15
下一篇:
PHP esc_html_e函数代码示例发布时间: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