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

PHP esc_html函数代码示例

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

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



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

示例1: cimy_um_download_database

function cimy_um_download_database()
{
    global $cum_upload_path;
    if (!empty($_POST["cimy_um_filename"])) {
        if (strpos($_SERVER['HTTP_REFERER'], admin_url('users.php?page=cimy_user_manager')) !== false) {
            // not whom we are expecting? exit!
            if (!check_admin_referer('cimy_um_download', 'cimy_um_downloadnonce')) {
                return;
            }
            $cimy_um_filename = $_POST["cimy_um_filename"];
            // sanitize the file name
            $cimy_um_filename = sanitize_file_name($cimy_um_filename);
            $cimy_um_fullpath_file = $cum_upload_path . $cimy_um_filename;
            // does not exist? exit!
            if (!is_file($cimy_um_fullpath_file)) {
                return;
            }
            header("Pragma: ");
            // Leave blank for issues with IE
            header("Expires: 0");
            header('Vary: User-Agent');
            header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
            header("Content-Type: text/csv");
            header("Content-Type: application/force-download");
            header("Content-Type: application/download");
            header("Content-Disposition: attachment; filename=\"" . esc_html($cimy_um_filename) . "\";");
            // cannot use esc_url any more because prepends 'http' (doh)
            header("Content-Transfer-Encoding: binary");
            header("Content-Length: " . filesize($cimy_um_fullpath_file));
            readfile($cimy_um_fullpath_file);
            exit;
        }
    }
}
开发者ID:bself,项目名称:nuimage-wp,代码行数:34,代码来源:cimy_user_manager.php


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


示例3: render_content

        public function render_content()
        {
            $args = array('orderby' => $this->orderby, 'order' => $this->order, 'taxonomy' => $this->taxonomy, 'hide_empty' => $this->hide_empty ? '1' : '0');
            $categories = get_categories($args);
            ?>
			<label>
				<span class="customize-control-title"><?php 
            echo esc_html($this->label);
            ?>
</span>
				<select <?php 
            $this->link();
            ?>
>
					<?php 
            // The default value (nothing is selected)
            printf("<option value='%s' %s>%s</option>", '0', selected($this->value(), '0', false), '— ' . __('Select', PARADOX_TF_I18NDOMAIN) . ' —');
            // Print all the other pages
            foreach ($categories as $category) {
                printf("<option value='%s' %s>%s</option>", esc_attr($category->term_id), selected($this->value(), $category->term_id, false), $category->name . ($this->show_count ? ' (' . $category->count . ')' : ''));
            }
            ?>
				</select>
			</label>
			<?php 
            echo "<p class='description'>{$this->description}</p>";
        }
开发者ID:AndyMarkle,项目名称:rocket,代码行数:27,代码来源:class-option-select-categories.php


示例4: get_terms_for_site

 /**
  * Return the terms for the given type.
  *
  * @param int $site_id Blog ID.
  *
  * @return array
  */
 public function get_terms_for_site($site_id)
 {
     $out = [];
     switch_to_blog($site_id);
     $taxonomy_object = get_taxonomy($this->taxonomy_name);
     if (!current_user_can($taxonomy_object->cap->edit_terms)) {
         $terms = [];
     } else {
         $terms = get_terms($this->taxonomy_name, ['hide_empty' => FALSE]);
     }
     foreach ($terms as $term) {
         if (is_taxonomy_hierarchical($this->taxonomy_name)) {
             $ancestors = get_ancestors($term->term_id, $this->taxonomy_name);
             if (!empty($ancestors)) {
                 foreach ($ancestors as $ancestor) {
                     $parent_term = get_term($ancestor, $this->taxonomy_name);
                     $term->name = $parent_term->name . '/' . $term->name;
                 }
             }
         }
         $out[$term->term_taxonomy_id] = esc_html($term->name);
     }
     restore_current_blog();
     uasort($out, 'strcasecmp');
     return $out;
 }
开发者ID:inpsyde,项目名称:multilingual-press,代码行数:33,代码来源:Mlp_Term_Translation_Presenter.php


示例5: render_content

    /**
     * Render the content on the theme customizer page
     */
    public function render_content()
    {
        if (!empty($this->menus)) {
            ?>
                <label>
                    <span class="customize-menu-dropdown"><?php 
            echo esc_html($this->label);
            ?>
</span>
                    <select name="<?php 
            echo $this->id;
            ?>
" id="<?php 
            echo $this->id;
            ?>
">
                    <?php 
            foreach ($this->menus as $menu) {
                printf('<option value="%s" %s>%s</option>', $menu->term_id, selected($this->value(), $menu->term_id, false), $menu->name);
            }
            ?>
                    </select>
                </label>
            <?php 
        }
    }
开发者ID:lucatume,项目名称:wp-customizer,代码行数:29,代码来源:paulund_MenuDropdownCustomControl.php


示例6: get_value

 /**
  * @see CPAC_Column::get_value()
  * @since 2.0
  */
 function get_value($post_id)
 {
     if (!($format = $this->get_raw_value($post_id))) {
         return false;
     }
     return esc_html(get_post_format_string($format));
 }
开发者ID:OneTimeUser,项目名称:retailwire,代码行数:11,代码来源:formats.php


示例7: display_region_drop_down

    public function display_region_drop_down()
    {
        $base_region = get_option('base_region');
        if (!empty($this->regions)) {
            ?>
				<select name='wpmlm_options[base_region]'>
					<?php 
            foreach ($this->regions as $region) {
                ?>
						<option value='<?php 
                echo esc_attr($region->id);
                ?>
' <?php 
                selected($region->id, $base_region);
                ?>
><?php 
                echo esc_html($region->name);
                ?>
</option>
					<?php 
            }
            ?>
				</select>
			<?php 
        }
    }
开发者ID:juano2h,项目名称:binary-mlm-ecommerce,代码行数:26,代码来源:general.php


示例8: showgallery

function showgallery()
{
    global $wpdb;
    $limit = 0;
    if (isset($_POST['search_events_by_title'])) {
        $search_tag = esc_html(stripslashes($_POST['search_events_by_title']));
        $search_tag = sanitize_text_field($search_tag);
    } else {
        $search_tag = '';
    }
    $cat_row_query = "SELECT id,name FROM " . $wpdb->prefix . "huge_itgallery_gallerys WHERE sl_width=0";
    $cat_row = $wpdb->get_results($cat_row_query);
    $query = $wpdb->prepare("SELECT COUNT(*) FROM " . $wpdb->prefix . "huge_itgallery_gallerys WHERE name LIKE %s", "%{$search_tag}}%");
    $total = $wpdb->get_var($query);
    $query = $wpdb->prepare("SELECT  a.* ,  COUNT(b.id) AS count, g.par_name AS par_name FROM " . $wpdb->prefix . "huge_itgallery_gallerys  AS a LEFT JOIN " . $wpdb->prefix . "huge_itgallery_gallerys AS b ON a.id = b.sl_width \nLEFT JOIN (SELECT  " . $wpdb->prefix . "huge_itgallery_gallerys.ordering as ordering," . $wpdb->prefix . "huge_itgallery_gallerys.id AS id, COUNT( " . $wpdb->prefix . "huge_itgallery_images.gallery_id ) AS prod_count\nFROM " . $wpdb->prefix . "huge_itgallery_images, " . $wpdb->prefix . "huge_itgallery_gallerys\nWHERE " . $wpdb->prefix . "huge_itgallery_images.gallery_id = " . $wpdb->prefix . "huge_itgallery_gallerys.id\nGROUP BY " . $wpdb->prefix . "huge_itgallery_images.gallery_id) AS c ON c.id = a.id LEFT JOIN\n(SELECT " . $wpdb->prefix . "huge_itgallery_gallerys.name AS par_name," . $wpdb->prefix . "huge_itgallery_gallerys.id FROM " . $wpdb->prefix . "huge_itgallery_gallerys) AS g\n ON a.sl_width=g.id WHERE a.name LIKE %s  group by a.id  ", "%" . $search_tag . "%");
    $rows = $wpdb->get_results($query);
    $rows = open_cat_in_tree($rows);
    $query = "SELECT  " . $wpdb->prefix . "huge_itgallery_gallerys.ordering," . $wpdb->prefix . "huge_itgallery_gallerys.id, COUNT( " . $wpdb->prefix . "huge_itgallery_images.gallery_id ) AS prod_count\nFROM " . $wpdb->prefix . "huge_itgallery_images, " . $wpdb->prefix . "huge_itgallery_gallerys\nWHERE " . $wpdb->prefix . "huge_itgallery_images.gallery_id = " . $wpdb->prefix . "huge_itgallery_gallerys.id\nGROUP BY " . $wpdb->prefix . "huge_itgallery_images.gallery_id ";
    $prod_rows = $wpdb->get_results($query);
    foreach ($rows as $row) {
        foreach ($prod_rows as $row_1) {
            if ($row->id == $row_1->id) {
                $row->ordering = $row_1->ordering;
                $row->prod_count = $row_1->prod_count;
            }
        }
    }
    $pageNav = '';
    $sort = '';
    $cat_row = open_cat_in_tree($cat_row);
    html_showgallerys($rows, $pageNav, $sort, $cat_row);
}
开发者ID:sammykumar,项目名称:TheVRForums,代码行数:32,代码来源:gallery_func.php


示例9: render_content

        public function render_content()
        {
            ?>
				<label>
					<span class="customize-control-title"><?php 
            echo esc_html($this->label);
            ?>
</span>
					<?php 
            if (!empty($this->description)) {
                ?>
						<span class="description customize-control-description"><?php 
                echo $this->description;
                ?>
</span>
					<?php 
            }
            ?>
				</label>
					
			<?php 
            echo '<div class="zerowp-customizer-fonts-block">';
            echo '<div class="zerowp-customizer-show-selected-font"><div class="zerowp-customizer-font-item"></div></div>
				<div class="zerowp-customizer-fonts">
					<input type="text" class="zerowp-customizer-fonts-search-field" placeholder="' . __('Search font', 'zerowp_customizer_local') . '" />
					<input type="hidden" class="zerowp-customizer-fonts-value" ' . $this->get_link() . ' ' . $this->value() . ' />' . $this->fontsList() . '</div>
			</div>';
        }
开发者ID:ZeroWP,项目名称:Customizer,代码行数:28,代码来源:control.class.php


示例10: genesis_search_form

/**
 * Replace the default search form with a Genesis-specific form.
 *
 * The exact output depends on whether the child theme supports HTML5 or not.
 *
 * Applies the `genesis_search_text`, `genesis_search_button_text`, `genesis_search_form_label` and
 * `genesis_search_form` filters.
 *
 * @since 0.2.0
 *
 * @uses genesis_html5() Check for HTML5 support.
 *
 * @return string HTML markup.
 */
function genesis_search_form()
{
    $search_text = get_search_query() ? apply_filters('the_search_query', get_search_query()) : apply_filters('genesis_search_text', __('Search this website', 'genesis') . ' &#x02026;');
    $button_text = apply_filters('genesis_search_button_text', esc_attr__('Search', 'genesis'));
    $onfocus = "if ('" . esc_js($search_text) . "' === this.value) {this.value = '';}";
    $onblur = "if ('' === this.value) {this.value = '" . esc_js($search_text) . "';}";
    //* Empty label, by default. Filterable.
    $label = apply_filters('genesis_search_form_label', '');
    $value_or_placeholder = get_search_query() == '' ? 'placeholder' : 'value';
    if (genesis_html5()) {
        $form = sprintf('<form %s>', genesis_attr('search-form'));
        if (genesis_a11y('search-form')) {
            if ('' == $label) {
                $label = apply_filters('genesis_search_text', __('Search this website', 'genesis'));
            }
            $form_id = uniqid('searchform-');
            $form .= sprintf('<meta itemprop="target" content="%s"/><label class="search-form-label screen-reader-text" for="%s">%s</label><input itemprop="query-input" type="search" name="s" id="%s" %s="%s" /><input type="submit" value="%s" /></form>', home_url('/?s={s}'), esc_attr($form_id), esc_html($label), esc_attr($form_id), $value_or_placeholder, esc_attr($search_text), esc_attr($button_text));
        } else {
            $form .= sprintf('%s<meta itemprop="target" content="%s"/><input itemprop="query-input" type="search" name="s" %s="%s" /><input type="submit" value="%s"  /></form>', esc_html($label), home_url('/?s={s}'), $value_or_placeholder, esc_attr($search_text), esc_attr($button_text));
        }
    } else {
        $form = sprintf('<form method="get" class="searchform search-form" action="%s" role="search" >%s<input type="text" value="%s" name="s" class="s search-input" onfocus="%s" onblur="%s" /><input type="submit" class="searchsubmit search-submit" value="%s" /></form>', home_url('/'), esc_html($label), esc_attr($search_text), esc_attr($onfocus), esc_attr($onblur), esc_attr($button_text));
    }
    return apply_filters('genesis_search_form', $form, $search_text, $button_text, $label);
}
开发者ID:Oak86,项目名称:matthewbuttler.work,代码行数:39,代码来源:search.php


示例11: execute

 public function execute()
 {
     $type = isset($_GET['type']) ? esc_html($_GET['type']) : 'display';
     $edit_type = isset($_GET['edit_type']) ? esc_html($_GET['edit_type']) : '';
     $image_id = isset($_GET['image_id']) ? esc_html($_GET['image_id']) : 0;
     $this->display($type);
 }
开发者ID:a-i-ko93,项目名称:ipl-foodblog,代码行数:7,代码来源:BWGControllerEditThumb.php


示例12: create_fields

        public static function create_fields($ops = array(), $options = array())
        {
            foreach ($ops as $k => $v) {
                if (!isset($v['type'])) {
                    continue;
                }
                switch ($v['type']) {
                    case 'select':
                        break;
                    default:
                        $output = '<input type="text" name="' . esc_attr($k) . '" id="' . esc_attr($k) . '" />';
                }
                ?>
				<tr valign="top">
					<th scope="row"><label for="<?php 
                echo esc_attr($k);
                ?>
"><?php 
                echo esc_html($v['label']);
                ?>
</label></th>
					<td class="forminp forminp-text">
						<?php 
                echo $output;
                ?>
					</td>
				</tr>
				<?php 
            }
        }
开发者ID:kinhdon2011,项目名称:nexthemes-plugins,代码行数:30,代码来源:class-nth-admin-templ.php


示例13: render_content

        public function render_content()
        {
            ?>
			<label>
				<span class="customize-control-title"><?php 
            echo esc_html($this->label);
            ?>
</span>
				<select <?php 
            $this->link();
            ?>
>
					<?php 
            foreach ($this->choices as $value => $label) {
                ?>
<optgroup label="<?php 
                echo $value;
                ?>
"><?php 
                foreach ($label as $subValue => $subLabel) {
                    printf("<option value=\"%s\" %s>%s</option>", esc_attr($subValue), selected($this->value(), $subValue, false), $subLabel);
                }
                ?>
</optgroup><?php 
            }
            ?>
				</select>
			</label>
			<?php 
            echo "<p class='description'>{$this->description}</p>";
        }
开发者ID:banna360,项目名称:genietheme-responsive,代码行数:31,代码来源:class-option-select.php


示例14: display_seller_review

 /**
  * Displaying Prodcuts
  *
  * Does prepare the data for displaying the products in the table.
  */
 function display_seller_review()
 {
     $data = array();
     $prefix = FARMTOYOU_META_PREFIX;
     //if search is call then pass searching value to function for displaying searching values
     $args = array('post_type' => FARMTOYOU_SELLER_REVIEW_POST_TYPE, 'post_status' => 'any', 'posts_per_page' => '-1');
     //get seller_review data from database
     $all_seller_review = get_posts($args);
     foreach ($all_seller_review as $key => $value) {
         $seller_id = get_post_meta($value->ID, $prefix . 'seller_id', true);
         $store_info = dokan_get_store_info($seller_id);
         $store_name = isset($store_info['store_name']) ? esc_html($store_info['store_name']) : __('N/A', 'dokan');
         $curr_user_id = get_post_meta($value->ID, $prefix . 'current_user_id', true);
         $user_info = get_userdata($curr_user_id);
         $first_name = $user_info->first_name;
         $last_name = $user_info->last_name;
         $user_email = $user_info->user_email;
         $data[$key]['ID'] = isset($value->ID) ? $value->ID : '';
         $data[$key]['seller_store'] = $store_name;
         $data[$key]['curr_user_name'] = $first_name . " " . $last_name;
         $data[$key]['curr_user_email'] = $user_email;
         $data[$key]['user_rating'] = get_post_meta($value->ID, $prefix . 'seller_rating', true);
         $data[$key]['user_comment'] = get_post_meta($value->ID, $prefix . 'user_comment', true);
         $data[$key]['post_status'] = isset($value->post_status) ? $value->post_status : '';
         $data[$key]['post_date'] = isset($value->post_date) ? $value->post_date : '';
     }
     return $data;
 }
开发者ID:abcode619,项目名称:wpstuff,代码行数:33,代码来源:custom-seller-review.php


示例15: validateXml

 /**
  * Validate XML to be valid for import
  * @param string $xml
  * @param WP_Error[optional] $errors
  * @return bool Validation status
  */
 public static function validateXml(&$xml, $errors = NULL)
 {
     if (FALSE === $xml or '' == $xml) {
         $errors and $errors->add('form-validation', __('WP All Import can\'t read your file.<br/><br/>Probably, you are trying to import an invalid XML feed. Try opening the XML feed in a web browser (Google Chrome is recommended for opening XML files) to see if there is an error message.<br/>Alternatively, run the feed through a validator: http://validator.w3.org/<br/>99% of the time, the reason for this error is because your XML feed isn\'t valid.<br/>If you are 100% sure you are importing a valid XML feed, please contact WP All Import support.', 'wp_all_import_plugin'));
     } else {
         PMXI_Import_Record::preprocessXml($xml);
         if (function_exists('simplexml_load_string')) {
             libxml_use_internal_errors(true);
             libxml_clear_errors();
             $_x = @simplexml_load_string($xml);
             $xml_errors = libxml_get_errors();
             libxml_clear_errors();
             if ($xml_errors) {
                 $error_msg = '<strong>' . __('Invalid XML', 'wp_all_import_plugin') . '</strong><ul>';
                 foreach ($xml_errors as $error) {
                     $error_msg .= '<li>';
                     $error_msg .= __('Line', 'wp_all_import_plugin') . ' ' . $error->line . ', ';
                     $error_msg .= __('Column', 'wp_all_import_plugin') . ' ' . $error->column . ', ';
                     $error_msg .= __('Code', 'wp_all_import_plugin') . ' ' . $error->code . ': ';
                     $error_msg .= '<em>' . trim(esc_html($error->message)) . '</em>';
                     $error_msg .= '</li>';
                 }
                 $error_msg .= '</ul>';
                 $errors and $errors->add('form-validation', $error_msg);
             } else {
                 return true;
             }
         } else {
             $errors and $errors->add('form-validation', __('Required PHP components are missing.', 'wp_all_import_plugin'));
             $errors and $errors->add('form-validation', __('WP All Import requires the SimpleXML PHP module to be installed. This is a standard feature of PHP, and is necessary for WP All Import to read the files you are trying to import.<br/>Please contact your web hosting provider and ask them to install and activate the SimpleXML PHP module.', 'wp_all_import_plugin'));
         }
     }
     return false;
 }
开发者ID:k-hasan-19,项目名称:wp-all-import,代码行数:40,代码来源:record.php


示例16: start_el

 /**
  * Starts the element output.
  *
  * @since 2.1.0
  * @access public
  *
  * @see Walker::start_el()
  *
  * @param string  $output Used to append additional content. Passed by reference.
  * @param WP_Post $page   Page data object.
  * @param int     $depth  Optional. Depth of page in reference to parent pages. Used for padding.
  *                        Default 0.
  * @param array   $args   Optional. Uses 'selected' argument for selected page to set selected HTML
  *                        attribute for option element. Uses 'value_field' argument to fill "value"
  *                        attribute. See wp_dropdown_pages(). Default empty array.
  * @param int     $id     Optional. ID of the current page. Default 0 (unused).
  */
 public function start_el(&$output, $page, $depth = 0, $args = array(), $id = 0)
 {
     $pad = str_repeat('&nbsp;', $depth * 3);
     if (!isset($args['value_field']) || !isset($page->{$args['value_field']})) {
         $args['value_field'] = 'ID';
     }
     $output .= "\t<option class=\"level-{$depth}\" value=\"" . esc_attr($page->{$args['value_field']}) . "\"";
     if ($page->ID == $args['selected']) {
         $output .= ' selected="selected"';
     }
     $output .= '>';
     $title = $page->post_title;
     if ('' === $title) {
         /* translators: %d: ID of a post */
         $title = sprintf(__('#%d (no title)'), $page->ID);
     }
     /**
      * Filters the page title when creating an HTML drop-down list of pages.
      *
      * @since 3.1.0
      *
      * @param string $title Page title.
      * @param object $page  Page data object.
      */
     $title = apply_filters('list_pages', $title, $page);
     $output .= $pad . esc_html($title);
     $output .= "</option>\n";
 }
开发者ID:robbenz,项目名称:plugs,代码行数:45,代码来源:class-walker-page-dropdown.php


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


示例18: wptreehouse_badges_options_page

function wptreehouse_badges_options_page()
{
    if (!current_user_can('manage_options')) {
        wp_die('You do not have sufficient permissions to access this page.');
    }
    global $plugin_url;
    global $options;
    global $display_json;
    if (isset($_POST['wptreehouse_form_submitted'])) {
        $hidden_field = esc_html($_POST['wptreehouse_form_submitted']);
        if ($hidden_field == 'Y') {
            $wptreehouse_username = esc_html($_POST['wptreehouse_username']);
            $wptreehouse_profile = wptreehouse_badges_get_profile($wptreehouse_username);
            $options['wptreehouse_username'] = $wptreehouse_username;
            $options['wptreehouse_profile'] = $wptreehouse_profile;
            $options['last_updated'] = time();
            update_option('wptreehouse_badges', $options);
        }
    }
    $options = get_option('wptreehouse_badges');
    if ($options != '') {
        $wptreehouse_username = $options['wptreehouse_username'];
        $wptreehouse_profile = $options['wptreehouse_profile'];
    }
    require 'inc/options-page-wrapper.php';
}
开发者ID:ariwinokur,项目名称:official-treehouse-badges-widgets-and-shortcodes,代码行数:26,代码来源:wptreehouse-badges.php


示例19: ultra_posted_on

 /**
  * Prints HTML with meta information for the current post-date/time, author, comment count and categories.
  */
 function ultra_posted_on()
 {
     echo '<div class="entry-meta-inner">';
     if (is_sticky() && is_home() && !is_paged()) {
         echo '<span class="featured-post">' . __('Sticky', 'ultra') . '</span>';
     }
     if (is_home() && siteorigin_setting('blog_post_date') || is_archive() && siteorigin_setting('blog_post_date') || is_search() && siteorigin_setting('blog_post_date')) {
         echo '<span class="entry-date"><a href="' . esc_url(get_permalink()) . '" rel="bookmark"><time class="published" datetime="' . esc_attr(get_the_date('c')) . '">' . esc_html(get_the_date('j F Y')) . '</time><time class="updated" datetime="' . esc_attr(get_the_modified_date('c')) . '">' . esc_html(get_the_modified_date()) . '</time></span></a>';
     }
     if (is_single() && siteorigin_setting('blog_post_date')) {
         echo '<span class="entry-date"><time class="published" datetime="' . esc_attr(get_the_date('c')) . '">' . esc_html(get_the_date('j F Y')) . '</time><time class="updated" datetime="' . esc_attr(get_the_modified_date('c')) . '">' . esc_html(get_the_modified_date()) . '</time></span>';
     }
     if (siteorigin_setting('blog_post_author')) {
         echo '<span class="byline"><span class="author vcard"><a class="url fn n" href="' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '" rel="author">' . esc_html(get_the_author()) . '</a></span></span>';
     }
     if (comments_open() && siteorigin_setting('blog_post_comment_count')) {
         echo '<span class="comments-link">';
         comments_popup_link(__('Leave a comment', 'ultra'), __('1 Comment', 'ultra'), __('% Comments', 'ultra'));
         echo '</span>';
     }
     echo '</div>';
     if (is_single() && siteorigin_setting('navigation_post_nav')) {
         the_post_navigation($args = array('prev_text' => '', 'next_text' => ''));
     }
 }
开发者ID:craighays,项目名称:wpcraighays,代码行数:28,代码来源:template-tags.php


示例20: start_el

 /**
  * Create the markup to start an element.
  *
  * @see Walker::start_el() for description of parameters.
  *
  * @param string $output Passed by reference. Used to append additional
  *        content.
  * @param object $item Menu item data object.
  * @param int $depth Depth of menu item. Used for padding.
  * @param object $args See {@Walker::start_el()}.
  * @param int $id See {@Walker::start_el()}.
  */
 public function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0)
 {
     global $_nav_menu_placeholder;
     $_nav_menu_placeholder = 0 > $_nav_menu_placeholder ? intval($_nav_menu_placeholder) - 1 : -1;
     $possible_object_id = isset($item->post_type) && 'nav_menu_item' == $item->post_type ? $item->object_id : $_nav_menu_placeholder;
     $possible_db_id = !empty($item->ID) && 0 < $possible_object_id ? (int) $item->ID : 0;
     $indent = $depth ? str_repeat("\t", $depth) : '';
     $output .= $indent . '<li>';
     $output .= '<label class="menu-item-title">';
     $output .= '<input type="checkbox" class="menu-item-checkbox';
     if (property_exists($item, 'label')) {
         $title = $item->label;
     }
     $output .= '" name="menu-item[' . $possible_object_id . '][menu-item-object-id]" value="' . esc_attr($item->object_id) . '" /> ';
     $output .= isset($title) ? esc_html($title) : esc_html($item->title);
     $output .= '</label>';
     if (empty($item->url)) {
         $item->url = $item->guid;
     }
     if (!in_array(array('umnm-menu', 'umnm-' . $item->post_excerpt . '-nav'), $item->classes)) {
         $item->classes[] = 'umnm-menu';
         $item->classes[] = 'umnm-' . $item->post_excerpt . '-nav';
     }
     // Menu item hidden fields
     $output .= '<input type="hidden" class="menu-item-db-id" name="menu-item[' . $possible_object_id . '][menu-item-db-id]" value="' . $possible_db_id . '" />';
     $output .= '<input type="hidden" class="menu-item-object" name="menu-item[' . $possible_object_id . '][menu-item-object]" value="' . esc_attr($item->object) . '" />';
     $output .= '<input type="hidden" class="menu-item-parent-id" name="menu-item[' . $possible_object_id . '][menu-item-parent-id]" value="' . esc_attr($item->menu_item_parent) . '" />';
     $output .= '<input type="hidden" class="menu-item-type" name="menu-item[' . $possible_object_id . '][menu-item-type]" value="custom" />';
     $output .= '<input type="hidden" class="menu-item-title" name="menu-item[' . $possible_object_id . '][menu-item-title]" value="' . esc_attr($item->title) . '" />';
     $output .= '<input type="hidden" class="menu-item-url" name="menu-item[' . $possible_object_id . '][menu-item-url]" value="' . esc_attr($item->url) . '" />';
     $output .= '<input type="hidden" class="menu-item-target" name="menu-item[' . $possible_object_id . '][menu-item-target]" value="' . esc_attr($item->target) . '" />';
     $output .= '<input type="hidden" class="menu-item-attr_title" name="menu-item[' . $possible_object_id . '][menu-item-attr_title]" value="' . esc_attr($item->attr_title) . '" />';
     $output .= '<input type="hidden" class="menu-item-classes" name="menu-item[' . $possible_object_id . '][menu-item-classes]" value="' . esc_attr(implode(' ', $item->classes)) . '" />';
     $output .= '<input type="hidden" class="menu-item-xfn" name="menu-item[' . $possible_object_id . '][menu-item-xfn]" value="' . esc_attr($item->xfn) . '" />';
 }
开发者ID:wpdelighter,项目名称:ultimate-member-navigation-menu,代码行数:47,代码来源:class-umnm-walker-nav-menu-checklist.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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