当前位置: 首页>>代码示例>>PHP>>正文


PHP esc_attr_x函数代码示例

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


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

示例1: oxford_comment_form_defaults

 /**
  * Change the comment form defaults.
  *
  * @since  1.0.
  *
  * @param  array    $defaults    The default values.
  * @return array                 The modified defaults.
  */
 function oxford_comment_form_defaults($defaults)
 {
     $input_size = 22;
     // Comment form title
     $defaults['title_reply'] = __('Leave a comment', 'oxford');
     // Comment form notes
     $defaults['comment_notes_before'] = '';
     $defaults['comment_notes_after'] = '';
     // Comment Author
     $comment_author = isset($_POST['author']) ? wp_strip_all_tags($_POST['author'], true) : null;
     $author_field = sprintf('<p class="comment-form-author"><input class="text-input respond-type" type="text" name="%1$s" id="%1$s" value="%3$s" size="%4$d" aria-required="true" tabindex="%5$d" placeholder="%2$s" /></p>', 'author', esc_attr_x('Name', 'comment field placeholder', 'oxford'), esc_attr($comment_author), $input_size, 1);
     // Comment Author Email
     $comment_author_email = isset($_POST['email']) ? trim($_POST['email']) : null;
     $email_field = sprintf('<p class="comment-form-email"><input class="text-input respond-type" type="email" name="%1$s" id="%1$s" value="%3$s" size="%4$d" aria-required="true" tabindex="%5$d" placeholder="%2$s" /></p>', 'email', esc_attr_x('Email', 'comment field placeholder', 'oxford'), esc_attr($comment_author_email), $input_size, 2);
     // Comment Author URL
     $comment_author_url = isset($_POST['url']) ? trim($_POST['url']) : null;
     $url_field = sprintf('<p class="comment-form-url"><input class="text-input respond-type" type="url" name="%1$s" id="%1$s" value="%3$s" size="%4$d" tabindex="%5$d" placeholder="%2$s" /></p>', 'url', esc_attr_x('Website', 'comment field placeholder', 'oxford'), esc_attr($comment_author_url), $input_size, 3);
     // Set the fields in the $defaults array
     $defaults['fields'] = array('author' => $author_field, 'email' => $email_field, 'url' => $url_field);
     // Comment Form
     $defaults['comment_field'] = sprintf('<p class="comment-form-comment"><textarea id="comment" class="blog-textarea respond-type" name="comment" cols="58" rows="10" aria-required="true" tabindex="4" placeholder="%s"></textarea></p>', esc_attr_x('Type reply here&hellip;', 'comment field placeholder', 'oxford'));
     // Submit label
     $defaults['label_submit'] = __('Post comment', 'oxford');
     return $defaults;
 }
开发者ID:andrewkhunn,项目名称:lancero,代码行数:33,代码来源:non-wpcom.php

示例2: vossen_jubi_get_search_form

    static function vossen_jubi_get_search_form($echo = true)
    {
        $format = current_theme_supports('html5', 'search-form') ? 'html5' : 'xhtml';
        $format = apply_filters('search_form_format', $format);
        if ('html5' == $format) {
            $form = ' <div class="widget-search"><form role="search" method="get" class="search-form" action="' . esc_url(home_url('/')) . '">
			 <div class="input-group">
			<input type="search" class="form-control search-input" placeholder="' . esc_attr_x('Search &hellip;', 'placeholder') . '" value="' . get_search_query() . '" name="s" title="' . esc_attr_x('Search for:', 'label') . '" />
			<span class="input-group-btn">
                                    <button class="btn btn-default search-button" type="submit">
					<i class="fa fa-search"></i>
                                    </button>
                                </span>
			</div>
			</form></div>';
        } else {
            $form = ' <div class="widget-search"><form role="search" method="get" id="searchform" class="searchform" action="' . esc_url(home_url('/')) . '">
			 <div class="input-group">
			<input type="text" class="form-control search-input" placeholder="' . esc_attr_x('Search &hellip;', 'placeholder') . '" value="' . get_search_query() . '" name="s" id="s" />
			 <span class="input-group-btn">
                                    <button class="btn btn-default search-button" type="submit">
					<i class="fa fa-search"></i>
                                    </button>
                                </span>
			</div>
			</form></div>';
        }
        return $form;
    }
开发者ID:lmacwan,项目名称:BreastPlasticSuregon_WP,代码行数:29,代码来源:OverrideWidgets.php

示例3: document_tag_slug_input

    /**
     * Show a slug input box.
     * @since  1.0.0
     */
    public function document_tag_slug_input()
    {
        ?>
	    <input name="documentate_permalinks[tag_base]" type="text" class="regular-text code" value="<?php 
        echo esc_attr(documentate_get_option('tag_base'));
        ?>
" placeholder="<?php 
        echo esc_attr_x('docu_tag', 'slug', 'documentate');
        ?>
" />
	    <?php 
    }
开发者ID:helgatheviking,项目名称:Documentate,代码行数:16,代码来源:class-docu-admin-permalink-settings.php

示例4: photo_perfect_customize_search_form

 /**
  * Customize search form.
  *
  * @since Photo Perfect 1.0
  */
 function photo_perfect_customize_search_form()
 {
     $search_placeholder = photo_perfect_get_option('search_placeholder');
     $form = '<form role="search" method="get" class="search-form" action="' . esc_url(home_url('/')) . '">
   <label>
     <span class="screen-reader-text">' . _x('Search for:', 'label', 'photo-perfect') . '</span>
     <input type="search" class="search-field" placeholder="' . esc_attr($search_placeholder) . '" value="' . get_search_query() . '" name="s" title="' . esc_attr_x('Search for:', 'label', 'photo-perfect') . '" />
   </label>
   <input type="submit" class="search-submit" value="' . esc_attr_x('Search', 'submit button', 'photo-perfect') . '" />
 </form>';
     return $form;
 }
开发者ID:LSYanJun,项目名称:wordpress,代码行数:17,代码来源:basic.php

示例5: taxonomy_slug_input

        /**
         * Show a slug input box.
         */
        public function taxonomy_slug_input()
        {
            $permalinks = get_option('elm_randomizer_permalinks');
            ?>
		<input name="elm_randomizer_taxonomy_slug" type="text" class="regular-text code" value="<?php 
            if (isset($permalinks['taxonomy_base'])) {
                echo esc_attr($permalinks['taxonomy_base']);
            }
            ?>
" placeholder="<?php 
            echo esc_attr_x('randomizer-category', 'slug', 'elm');
            ?>
" />
		<?php 
        }
开发者ID:elementous,项目名称:content-randomizer,代码行数:18,代码来源:permalink-settings.php

示例6: portfolio_tag_slug_input

    /**
     * Show a slug input box.
     */
    public function portfolio_tag_slug_input()
    {
        $permalinks = get_option('axiscomposer_permalinks');
        ?>
		<input name="axiscomposer_portfolio_tag_slug" type="text" class="regular-text code" value="<?php 
        if (isset($permalinks['tag_base'])) {
            echo esc_attr($permalinks['tag_base']);
        }
        ?>
" placeholder="<?php 
        echo esc_attr_x('portfolio-tag', 'slug', 'axiscomposer');
        ?>
" />
		<?php 
    }
开发者ID:axisthemes,项目名称:axiscomposer,代码行数:18,代码来源:class-ac-admin-permalink-settings.php

示例7: product_tag_slug_input

        /**
         * Show a slug input box.
         */
        public function product_tag_slug_input()
        {
            $permalinks = get_option('woocommerce_permalinks');
            ?>
		<input name="woocommerce_product_tag_slug" type="text" class="regular-text code" value="<?php 
            if (isset($permalinks['tag_base'])) {
                echo esc_attr($permalinks['tag_base']);
            }
            ?>
" placeholder="<?php 
            echo esc_attr_x('product-tag', 'slug', 'woocommerce');
            ?>
" />
		<?php 
        }
开发者ID:bitoncoin,项目名称:woocommerce,代码行数:18,代码来源:class-wc-admin-permalink-settings.php

示例8: event_action_links

 /**
  * Injects action links into the attendee screen.
  *
  * @param $event_id
  */
 public function event_action_links($event_id)
 {
     $action_links = array('<a href="' . esc_url(get_edit_post_link($event_id)) . '" title="' . esc_attr_x('Edit', 'attendee event actions', 'event-tickets') . '">' . esc_html_x('Edit', 'attendee event actions', 'event-tickets') . '</a>', '<a href="' . esc_url(get_permalink($event_id)) . '" title="' . esc_attr_x('View', 'attendee event actions', 'event-tickets') . '">' . esc_html_x('View', 'attendee event actions', 'event-tickets') . '</a>');
     /**
      * Provides an opportunity to add and remove action links from the
      * attendee screen summary box.
      *
      * @param array $action_links
      */
     $action_links = (array) apply_filters('tribe_tickets_attendees_event_action_links', $action_links);
     if (empty($action_links)) {
         return;
     }
     echo '<div class="event-actions">' . join(' | ', $action_links) . '</div>';
 }
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:20,代码来源:Tickets_Handler.php

示例9: call_some_i18n_methods

function call_some_i18n_methods()
{
    __('Hello World', 'test-domain');
    _e('Hello World', 'test-domain');
    _n('Single', 'Plural', 1, 'test-domain');
    _n_noop('Single Noop', 'Plural Noop', 1, 'test-domain');
    _x('Hello World', 'Testing', 'test-domain');
    _ex('Hello World', 'Testing', 'test-domain');
    _nx('Hello World', 'Testing', 'test-domain');
    _nx_noop('Hello World Noop', 'Testing', 'test-domain');
    esc_attr__('Attribute', 'test-domain');
    esc_html__('HTML', 'test-domain');
    esc_attr_e('Attribute', 'test-domain');
    esc_html_e('HTML', 'test-domain');
    esc_attr_x('Attribute', 'Testing', 'test-domain');
    esc_html_x('HTML', 'Testing', 'test-domain');
    translate_nooped_plural('Plural Noop', 2, 'test-domain');
}
开发者ID:dd32,项目名称:wordpress.develop,代码行数:18,代码来源:add-textdomain-0-result.php

示例10: wpex_mobile_search

    function wpex_mobile_search()
    {
        ?>
		<div id="mobile-search">
			<form method="get" action="<?php 
        echo esc_url(home_url('/'));
        ?>
" role="search" id="mobile-search-form">
				<input type="search" class="field" name="s" value="<?php 
        echo esc_attr(get_search_query());
        ?>
" placeholder="<?php 
        echo esc_attr_x('To search type and hit enter', 'wpex');
        ?>
" />
			</form>
		</div>
	<?php 
    }
开发者ID:kulgee001,项目名称:MyMusic-Wordpress,代码行数:19,代码来源:mobile-search.php

示例11: widget

    /**
     * Front-end display of widget.
     *
     * @see WP_Widget::widget()
     * @since 3.2.0
     *
     *
     * @param array $args     Widget arguments.
     * @param array $instance Saved values from database.
     */
    public function widget($args, $instance)
    {
        // Set vars for widget usage
        $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
        $filter_page = empty($instance['filter_page']) ? '' : (int) $instance['filter_page'];
        // Before widget WP hook
        echo $args['before_widget'];
        // Display title if defined
        if ($title) {
            echo $args['before_title'] . $title . $args['after_title'];
        }
        ?>

		<form role="search" method="get" class="search-form" action="<?php 
        echo get_page_link($filter_page);
        ?>
">
			<input type="search" class="search-field" placeholder="<?php 
        echo esc_attr_x('Search &hellip;', 'placeholder', 'wpsp_admin');
        ?>
" value="<?php 
        if (!empty($_GET['p'])) {
            echo $_GET['p'];
        }
        ?>
" name="p" title="<?php 
        echo esc_attr_x('Search for:', 'label', 'wpsp_admin');
        ?>
" />
			<button type="submit" class="search-submit"><span class="screen-reader-text"><?php 
        echo _x('Search', 'submit button', 'wpsp_admin');
        ?>
</span></button>
		</form>

		<?php 
        // After widget WP hook
        echo $args['after_widget'];
        ?>
		
	<?php 
    }
开发者ID:sptheme,项目名称:learninginstitute,代码行数:52,代码来源:publications-search-widget.php

示例12: shopping_header_right

function shopping_header_right()
{
    ?>
	

	<aside class="header-right widget-area sidebar">
		
		<?php 
    if (is_active_sidebar('header-right')) {
        dynamic_sidebar('header-right');
    } else {
        ?>
			<section class="widget widget_search widget-widget_search">

	    		<div class="widget-wrap">
					<form role="search" method="get" class="search-form" action="<?php 
        echo esc_url(home_url('/'));
        ?>
">
			
						<input type="search" class="search-field" placeholder="<?php 
        echo esc_attr_x('Search &hellip;', 'placeholder', 'shopping');
        ?>
" value="<?php 
        echo esc_attr(get_search_query());
        ?>
" name="s" title="<?php 
        _ex('Search for:', 'label', 'shopping');
        ?>
">
						
					</form>
				</div>
			</section>
		<?php 
    }
    ?>

  	</aside><!-- .sidebar -->

	<?php 
}
开发者ID:ericvyc,项目名称:mtp,代码行数:42,代码来源:functions.php

示例13: widget

 /**
  * front-end display of widget
  * 
  * @see WP_Widget::widget()
  * @param array $args     Widget arguments.
  * @param array $instance Saved values from database.
  */
 public function widget($args, $instance)
 {
     $navbaralign = $this->navbaralign;
     if (isset($instance['navbaralign']) && $instance['navbaralign'] != null) {
         $navbaralign = $instance['navbaralign'];
     }
     // set output front-end widget ---------------------------------
     $output = $args['before_widget'];
     $output .= '<form class="navbar-form ' . $navbaralign . '" action="' . esc_url(home_url('/')) . '" role="search">';
     $output .= '<div class="form-group">';
     $output .= '<input type="text" name="s" class="form-control" placeholder="' . esc_attr_x('Search &hellip;', 'placeholder', 'son-of-a-saint') . '" value="' . esc_attr(get_search_query()) . '" title="' . esc_attr_x('Search for:', 'label', 'son-of-a-saint') . '">';
     $output .= '</div>';
     $output .= ' ';
     $output .= '<button type="submit" class="btn btn-default">' . esc_html__('Search', 'son-of-a-saint') . '</button>';
     $output .= '</form>';
     $output .= $args['after_widget'];
     echo $output;
     // clear unused variables
     unset($output);
 }
开发者ID:keeganbrown,项目名称:Son-of-a-Saint-Theme,代码行数:27,代码来源:BootstrapBasicSearchWidget.php

示例14: pranon_get_search_form

    static function pranon_get_search_form($echo = true)
    {
        $format = current_theme_supports('html5', 'search-form') ? 'html5' : 'xhtml';
        $format = apply_filters('search_form_format', $format);
        if ('html5' == $format) {
            $form = ' <div class="widget-search"><form role="search" method="get" class="searchForm light" action="' . esc_url(home_url('/')) . '">
			 <div class="input-group">
			<input type="search" class="form-control search-input" placeholder="' . esc_attr_x('Search &hellip;', 'placeholder') . '" value="' . get_search_query() . '" name="s" title="' . esc_attr_x('Search for:', 'label') . '" />
			 <input type="submit" class="submitSearch" value="Ok">
			</div>
			</form></div>';
        } else {
            $form = ' <div class="widget-search"><form role="search" method="get" id="searchform" class="searchForm light" action="' . esc_url(home_url('/')) . '">
			 <div class="input-group">
			<input type="text" class="form-control search-input" placeholder="' . esc_attr_x('Search &hellip;', 'placeholder') . '" value="' . get_search_query() . '" name="s" id="s" />
			 <input type="submit" class="submitSearch" value="Ok">
			</div>
			</form></div>';
        }
        return $form;
    }
开发者ID:pranonTeam,项目名称:pranon_wp_development,代码行数:21,代码来源:OverrideWidgets.php

示例15: get_search_form

function get_search_form($echo = true)
{
    do_action('pre_get_search_form');
    $format = current_theme_supports('html5', 'search-form') ? 'html5' : 'xhtml';
    $format = apply_filters('search_form_format', $format);
    $search_form_template = locate_template('searchform.php');
    if ('' != $search_form_template) {
        ob_start();
        require $search_form_template;
        $form = ob_get_clean();
    } else {
        if ('html5' == $format) {
            $form = '<form role="search" method="get" class="search-form" action="' . esc_url(home_url('/')) . '">
				<label>
					<span class="screen-reader-text">' . _x('Search for:', 'label') . '</span>
					<input type="search" class="search-field" placeholder="' . esc_attr_x('Search &hellip;', 'placeholder') . '" value="' . get_search_query() . '" name="s" title="' . esc_attr_x('Search for:', 'label') . '" />
				</label>
				<input type="submit" class="search-submit" value="' . esc_attr_x('Search', 'submit button') . '" />
			</form>';
        } else {
            $form = '<form role="search" method="get" id="searchform" class="searchform" action="' . esc_url(home_url('/')) . '">
				<div>
					<label class="screen-reader-text" for="s">' . _x('Search for:', 'label') . '</label>
					<input type="text" value="' . get_search_query() . '" name="s" id="s" />
					<input type="submit" id="searchsubmit" value="' . esc_attr_x('Search', 'submit button') . '" />
				</div>
			</form>';
        }
    }
    $result = apply_filters('get_search_form', $form);
    if (null === $result) {
        $result = $form;
    }
    if ($echo) {
        echo $result;
    } else {
        return $result;
    }
}
开发者ID:AppItNetwork,项目名称:yii2-wordpress-themes,代码行数:39,代码来源:general-template.php


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