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


PHP esc_textarea函数代码示例

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


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

示例1: wikiembed_network_site_admin_options

/**
 * wikiembed_network_site_admin_options function.
 * 
 * @access public
 * @return void
 */
function wikiembed_network_site_admin_options()
{
    ?>
		<h3><?php 
    _e('Wiki Embed Settings');
    ?>
</h3> 
		<table class="form-table">
			<tr valign="top"> 
				<th scope="row"><label for="wiki_embed_white_list"><?php 
    _e('White List of Allowed Sites');
    ?>
</label></th> 
				<td>
	                <textarea type="text" name="wiki_embed_white_list" id="wiki_embed_white_list" class="regular-text" style="width:100%; height:200px;" ><?php 
    echo esc_textarea(get_site_option('wiki_embed_white_list'));
    ?>
 </textarea>
					<br />
					<span>separate urls with new lines </span>
				</td>
			</tr>
		</table>
<?php 
}
开发者ID:nemobis,项目名称:wiki-embed,代码行数:31,代码来源:admin.php

示例2: Grafik_MetaStyles_Callback

function Grafik_MetaStyles_Callback($entry)
{
    // Get Stored Meta Values...
    $PREFILL = array('grafik-meta-styles-noglobal' => (int) get_post_meta($entry->ID, 'grafik-meta-styles-noglobal', true), 'grafik-meta-styles-notype' => (int) get_post_meta($entry->ID, 'grafik-meta-styles-notype', true), 'grafik-meta-styles' => stripslashes(esc_textarea(base64_decode(get_post_meta($entry->ID, 'grafik-meta-styles', true)))));
    // Output Meta Controls...
    echo '<div class="grafik-metabox">' . wp_nonce_field('grafik-nonce-metastyles', 'grafik-nonce-metastyles', true, false) . '<table>' . '<tr>' . '<td>' . '<strong>Style Configuration:</strong>' . '<p>By default, each post/page inherits the global and corresponding type styles. If you would like this post/page to not inherit these assets, you can disable them here.</p>' . '<p>' . '<input type="checkbox" name="grafik-meta-styles-noglobal" id="grafik-meta-styles-noglobal" ' . ($PREFILL['grafik-meta-styles-noglobal'] == 1 ? 'checked="checked"' : null) . '/>' . '<label for="grafik-meta-styles-noglobal">Do Not Use Global Styles</label>' . '</p>' . '<p>' . '<input type="checkbox" name="grafik-meta-styles-notype" id="grafik-meta-styles-notype" ' . ($PREFILL['grafik-meta-styles-notype'] == 1 ? 'checked="checked"' : null) . '/>' . '<label for="grafik-meta-styles-notype">Do Not Use Type Styles</label>' . '</p>' . '<p><textarea name="grafik-meta-styles">' . $PREFILL['grafik-meta-styles'] . '</textarea></p>' . '</td>' . '</tr>' . '</table>' . '</div>';
}
开发者ID:GrafikMatthew,项目名称:Grafik-Engine-Alpha,代码行数:7,代码来源:styles.php

示例3: display_field_options

    /**
     * 設定画面にフィールドを表示(オリジナル項目)
     *
     * @param int $group_key
     * @param int $field_key
     */
    public function display_field_options($group_key, $field_key)
    {
        ?>
		<tr>
			<th><?php 
        esc_html_e('Choices', 'smart-custom-fields');
        ?>
</th>
			<td>
				<textarea
					name="<?php 
        echo esc_attr($this->get_field_name_in_setting($group_key, $field_key, 'choices'));
        ?>
"
					class="widefat"
					rows="5" /><?php 
        echo esc_textarea("\n" . $this->get('choices'));
        ?>
</textarea>
			</td>
		</tr>
		<tr>
			<th><?php 
        esc_html_e('Default', 'smart-custom-fields');
        ?>
</th>
			<td>
				<input type="text"
					name="<?php 
        echo esc_attr($this->get_field_name_in_setting($group_key, $field_key, 'default'));
        ?>
"
					class="widefat"
					value="<?php 
        echo esc_attr($this->get('default'));
        ?>
" />
			</td>
		</tr>
		<tr>
			<th><?php 
        esc_html_e('Notes', 'smart-custom-fields');
        ?>
</th>
			<td>
				<input type="text"
					name="<?php 
        echo esc_attr($this->get_field_name_in_setting($group_key, $field_key, 'notes'));
        ?>
"
					class="widefat"
					value="<?php 
        echo esc_attr($this->get('notes'));
        ?>
"
				/>
			</td>
		</tr>
		<?php 
    }
开发者ID:hideokamoto,项目名称:smart-custom-fields,代码行数:66,代码来源:class.field-select.php

示例4: form

 function form($instance)
 {
     $instance = wp_parse_args((array) $instance, array('code' => ''));
     $code = $instance['code'];
     echo '<p><label for="' . esc_attr($this->get_field_id('code')) . '">' . __('Zone Code:', 'ci_theme') . '</label><textarea rows="10" id="' . esc_attr($this->get_field_id('code')) . '" name="' . esc_attr($this->get_field_name('code')) . '" class="widefat" >' . esc_textarea($code) . '</textarea></p>';
     echo '<p>' . sprintf(__('Paste your <strong>Zone Code</strong> here, as described in this <a href="%s">BuySellAds tutorial</a>.', 'ci_theme'), esc_url('http://support.buysellads.com/knowledge_base/topics/how-to-install-your-ad-code')) . '</p>';
 }
开发者ID:nickolasnikolic,项目名称:wordpress-heroku-php,代码行数:7,代码来源:ci_widget_bsa.php

示例5: render_field

 function render_field($field)
 {
     // vars
     $atts = array();
     $o = array('id', 'class', 'name', 'placeholder', 'rows');
     $s = array('readonly', 'disabled');
     $e = '';
     // maxlength
     if ($field['maxlength']) {
         $o[] = 'maxlength';
     }
     // rows
     if (empty($field['rows'])) {
         $field['rows'] = 8;
     }
     // append atts
     foreach ($o as $k) {
         $atts[$k] = $field[$k];
     }
     // append special atts
     foreach ($s as $k) {
         if (!empty($field[$k])) {
             $atts[$k] = $k;
         }
     }
     $e .= '<textarea ' . acf_esc_attr($atts) . ' >';
     $e .= esc_textarea($field['value']);
     $e .= '</textarea>';
     // return
     echo $e;
 }
开发者ID:Garth619,项目名称:Femi9,代码行数:31,代码来源:textarea.php

示例6: 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 
        }
        ?>

			<textarea class="large-text" cols="20" rows="5" <?php 
        $this->link();
        ?>
>
				<?php 
        echo esc_textarea($this->value());
        ?>
			</textarea>
		</label>
		<?php 
    }
开发者ID:sayedwp,项目名称:marvy,代码行数:31,代码来源:class-wp-customize-control.php

示例7: sendMail

/**
 * Validate data and send mail.
 *
 * @see http://codex.wordpress.org/Function_Reference/wp_mail
 * @return {int} Status of message:
 * -2 => Invalid data
 * -1 => Failed to send
 *  1 => OK
 */
function sendMail()
{
    header("Content-Type: application/json");
    $response = array('status' => -2, 'errors' => array());
    if (!isset($_POST['name']) || !isset($_POST['email']) || !isset($_POST['message'])) {
        echo json_encode($response);
        die;
    }
    $name = esc_attr($_POST['name']);
    $email = sanitize_email($_POST['email']);
    $message = esc_textarea($_POST['message']);
    if (!strlen($name)) {
        $response['errors']['name'] = "C'mon, what's your name?";
    }
    if (!is_email($email)) {
        $response['errors']['email'] = "Please, give us valid email.";
    }
    if (!strlen($message)) {
        $response['errors']['message'] = "No message, huh?";
    }
    if (empty($response['errors'])) {
        $to = get_bloginfo('admin_email');
        $subject = 'Contact from ' . get_bloginfo('name');
        $headers[] = "From: {$name} <{$email}>";
        $isSent = wp_mail($to, $subject, $message, $headers);
        $response['status'] = $isSent ? 1 : -1;
    }
    echo json_encode($response);
    die;
}
开发者ID:sachsy,项目名称:snippets-1,代码行数:39,代码来源:wp.sendMail.php

示例8: ts_essentials_escape

function ts_essentials_escape($str = '', $type = '', $context = '')
{
    if (trim($str)) {
        if ($type == 'strip') {
            if ($context == 'widget_before_after') {
                return strip_tags($str, '<div><ul><li>');
            } elseif ($context == 'widget_title_before_after') {
                return strip_tags($str, '<div><ul><li><h3><h4><h5><h6><strong><em><i><b><span>');
            } elseif (substr($context, 0, 1) == '<') {
                return strip_tags($str, $context);
            } else {
                return strip_tags($str);
            }
        } elseif ($type == 'bal' || $type == 'balance') {
            return balanceTags($str);
        } elseif ($type == 'attr') {
            return esc_attr($str);
        } elseif ($type == 'html') {
            return esc_html($str);
        } elseif ($type == 'url') {
            return esc_url($str);
        } elseif ($type == 'js') {
            return esc_js($str);
        } elseif ($type == 'textarea') {
            return esc_textarea($str);
        } elseif ($type == 'sql') {
            return esc_sql($str);
        } elseif ($type == 'post') {
            return wp_kses_post($str);
        }
    }
    return $str;
}
开发者ID:estvmachine,项目名称:nicowp,代码行数:33,代码来源:functions.php

示例9: Grafik_MetaFooter_Callback

function Grafik_MetaFooter_Callback($entry)
{
    // Get Stored Meta Values...
    $PREFILL = array('grafik-meta-footer-noglobal' => (int) get_post_meta($entry->ID, 'grafik-meta-footer-noglobal', true), 'grafik-meta-footer-notype' => (int) get_post_meta($entry->ID, 'grafik-meta-footer-notype', true), 'grafik-meta-footer-tl' => stripslashes(esc_textarea(base64_decode(get_post_meta($entry->ID, 'grafik-meta-footer-tl', true)))), 'grafik-meta-footer-tr' => stripslashes(esc_textarea(base64_decode(get_post_meta($entry->ID, 'grafik-meta-footer-tr', true)))), 'grafik-meta-footer-ml' => stripslashes(esc_textarea(base64_decode(get_post_meta($entry->ID, 'grafik-meta-footer-ml', true)))), 'grafik-meta-footer-mr' => stripslashes(esc_textarea(base64_decode(get_post_meta($entry->ID, 'grafik-meta-footer-mr', true)))), 'grafik-meta-footer-bl' => stripslashes(esc_textarea(base64_decode(get_post_meta($entry->ID, 'grafik-meta-footer-bl', true)))), 'grafik-meta-footer-br' => stripslashes(esc_textarea(base64_decode(get_post_meta($entry->ID, 'grafik-meta-footer-br', true)))));
    // Output Meta Controls...
    echo '<div class="grafik-metabox">' . wp_nonce_field('grafik-nonce-metafooter', 'grafik-nonce-metafooter', true, false) . '<table>' . '<tr>' . '<td colspan="2">' . '<p>By default, each post/page inherits the global and corresponding type footer. If you would like this post/page to not inherit these assets, you can disable them here.</p>' . '<p>' . '<input type="checkbox" name="grafik-meta-footer-noglobal" id="grafik-meta-footer-noglobal" ' . ($PREFILL['grafik-meta-footer-noglobal'] == 1 ? 'checked="checked"' : null) . '/>' . '<label for="grafik-meta-footer-noglobal">Do Not Use Global Footer</label>' . '</p>' . '<p>' . '<input type="checkbox" name="grafik-meta-footer-notype" id="grafik-meta-footer-notype" ' . ($PREFILL['grafik-meta-footer-notype'] == 1 ? 'checked="checked"' : null) . '/>' . '<label for="grafik-meta-footer-notype">Do Not Use Type Footer</label>' . '</p>' . '</td>' . '</tr>' . '<tr>' . '<td>' . '<strong>Footer Top Left:</strong>' . '<p><textarea name="grafik-meta-footer-tl">' . $PREFILL['grafik-meta-footer-tl'] . '</textarea></p>' . '</td>' . '<td>' . '<strong>Footer Top Right:</strong>' . '<p><textarea name="grafik-meta-footer-tr">' . $PREFILL['grafik-meta-footer-tr'] . '</textarea></p>' . '</td>' . '</tr>' . '<tr>' . '<td>' . '<strong>Footer Top Left:</strong>' . '<p><textarea name="grafik-meta-footer-ml">' . $PREFILL['grafik-meta-footer-ml'] . '</textarea></p>' . '</td>' . '<td>' . '<strong>Footer Top Right:</strong>' . '<p><textarea name="grafik-meta-footer-mr">' . $PREFILL['grafik-meta-footer-mr'] . '</textarea></p>' . '</td>' . '</tr>' . '<tr>' . '<td>' . '<strong>Footer Top Left:</strong>' . '<p><textarea name="grafik-meta-footer-bl">' . $PREFILL['grafik-meta-footer-bl'] . '</textarea></p>' . '</td>' . '<td>' . '<strong>Footer Top Right:</strong>' . '<p><textarea name="grafik-meta-footer-br">' . $PREFILL['grafik-meta-footer-br'] . '</textarea></p>' . '</td>' . '</tr>' . '</table>' . '</div>';
}
开发者ID:GrafikMatthew,项目名称:Grafik-Engine-Alpha,代码行数:7,代码来源:footers.php

示例10: render_content

        public function render_content()
        {
            switch ($this->type) {
                case 'textarea':
                    echo '<div class="' . $this->type . '-pro-feature">';
                    echo '<span class="pro-badge">PRO</span>';
                    ?>
		           <label>
		                <span class="customize-control-title"><?php 
                    echo esc_html($this->label);
                    ?>
</span>
		                  <textarea class="large-text" cols="20" rows="5" <?php 
                    $this->link();
                    ?>
 disabled >
		                    <?php 
                    echo esc_textarea($this->value());
                    ?>
		                  </textarea>
		            </label>
		         <?php 
                    echo '</div><!--/pro-feature-->';
                    break;
                case 'input':
                    ?>



		        <?php 
                    break;
            }
            // end SWITCH statement
        }
开发者ID:web-way,项目名称:web-way,代码行数:34,代码来源:custom-controls.php

示例11: deliver_mail

function deliver_mail()
{
    // if the submit button is clicked, send the email
    if (isset($_POST['cf-submitted']) && $_POST["cf-url"] == '') {
        // sanitize form values
        $name = sanitize_text_field($_POST["cf-name"]);
        $email = sanitize_email($_POST["cf-email"]);
        $subject = 'Website Contact and Prayer Request Form Submission';
        $message = esc_textarea($_POST["cf-message"]);
        // get the blog administrator's email address
        $to = get_field('main_campus_email', 'options');
        //$to = 'krissie@honeystreet.com';
        $headers = "From: {$name} <{$email}>" . "\r\n";
        // If email has been process for sending, display a success message
        if (wp_mail($to, $subject, $message, $headers)) {
            echo '<div>';
            echo '<p class="success">Thanks for getting in touch with us. Your request has been submitted.</p>';
            echo '</div>';
        } else {
            echo '<div>';
            echo '<p class="error">We\'re terribly sorry, but it looks like an error occurred. Please make sure all fields are filled out and try submitting your request again.</p>';
            echo '</div>';
        }
    }
}
开发者ID:KrissieV,项目名称:LBC-multisite,代码行数:25,代码来源:contact.php

示例12: Grafik_MetaPreviews_Callback

function Grafik_MetaPreviews_Callback($entry)
{
    // Get Stored Meta Values...
    $PREFILL = array('grafik-meta-preview-desktop' => stripslashes(esc_textarea(base64_decode(get_post_meta($entry->ID, 'grafik-meta-preview-desktop', true)))), 'grafik-meta-preview-tablet' => stripslashes(esc_textarea(base64_decode(get_post_meta($entry->ID, 'grafik-meta-preview-tablet', true)))), 'grafik-meta-preview-phone' => stripslashes(esc_textarea(base64_decode(get_post_meta($entry->ID, 'grafik-meta-preview-phone', true)))));
    // Output Meta Controls...
    echo wp_nonce_field('grafik-nonce-metapreviews', 'grafik-nonce-metapreviews', true, false) . '<table>' . '<tr>' . '<th><label for="grafik-meta-preview-desktop">Desktop:</label></th>' . '<td><input type="text" name="grafik-meta-preview-desktop" value="' . $PREFILL['grafik-meta-preview-desktop'] . '" id="grafik-meta-preview-desktop" /></td>' . '</tr>' . '<tr>' . '<th><label for="grafik-meta-preview-tablet">Tablet:</label></th>' . '<td><input type="text" name="grafik-meta-preview-tablet" value="' . $PREFILL['grafik-meta-preview-tablet'] . '" id="grafik-meta-preview-tablet" /></td>' . '</tr>' . '<tr>' . '<th><label for="grafik-meta-preview-phone">Phone:</label></th>' . '<td><input type="text" name="grafik-meta-preview-phone" value="' . $PREFILL['grafik-meta-preview-phone'] . '" id="grafik-meta-preview-phone" /></td>' . '</tr>' . '</table>';
}
开发者ID:GrafikMatthew,项目名称:Grafik-Engine-Alpha,代码行数:7,代码来源:previews.php

示例13: Patterns_Main_Meta_Box_Save

 /**
  * Save the meta when the post is saved.
  *
  * @param int $post_id The ID of the post being saved.
  */
 public function Patterns_Main_Meta_Box_Save($post_id)
 {
     /*
      * We need to verify this came from the our screen and with proper authorization,
      * because save_post can be triggered at other times.
      */
     // Check if our nonce is set.
     if (!isset($_POST['patterns_main_inner_custom_box_nonce'])) {
         return $post_id;
     }
     $nonce = $_POST['patterns_main_inner_custom_box_nonce'];
     // Verify that the nonce is valid.
     if (!wp_verify_nonce($nonce, 'patterns_main_inner_custom_box')) {
         return $post_id;
     }
     // If this is an autosave, our form has not been submitted,
     //     so we don't want to do anything.
     if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
         return $post_id;
     }
     // Check the user's permissions.
     if (!current_user_can('edit_post', $post_id)) {
         return $post_id;
     }
     /* OK, its safe for us to save the data now. */
     // Sanitize the user input.
     $code_data = esc_html($_POST['patterns_code_content']);
     $desc_data = esc_textarea($_POST['patterns_code_desc']);
     // Update the meta field.
     update_post_meta($post_id, '_Patterns__Main_code_value', $code_data);
     update_post_meta($post_id, '_Patterns__Main_desc_value', $desc_data);
 }
开发者ID:emaildano,项目名称:patterns,代码行数:37,代码来源:class-patterns-meta-boxes.php

示例14: render_content

    public function render_content()
    {
        ?>
		<label>
			<span class="customize-control-title">
				<?php 
        echo esc_html($this->label);
        ?>
				<?php 
        if (!empty($this->description)) {
            ?>
					<span class="description customize-control-description"><?php 
            echo $this->description;
            ?>
</span>
				<?php 
        }
        ?>
			</span>
			<input type="text" data-palette="<?php 
        echo esc_textarea($this->palette);
        ?>
" data-default-color="<?php 
        echo esc_attr($this->default);
        ?>
" value="<?php 
        echo esc_attr($this->value());
        ?>
" class="kirki-color-control" <?php 
        $this->link();
        ?>
  />
		</label>
	<?php 
    }
开发者ID:vulinhpc,项目名称:kirki,代码行数:35,代码来源:class-kirki-controls-color-alpha-control.php

示例15: saga_save_theme_settings

function saga_save_theme_settings()
{
    global $pagenow;
    $settings = get_option("saga_theme_settings");
    if ($pagenow == 'themes.php' && $_GET['page'] == 'theme-settings') {
        if (isset($_GET['tab'])) {
            $tab = $_GET['tab'];
        } else {
            $tab = 'homepage';
        }
        switch ($tab) {
            case 'general':
                $settings['saga_tag_class'] = $_POST['saga_tag_class'];
                $settings['saga_deal_week'] = $_POST['saga_deal_week'];
                $settings['saga_deal_week_name'] = $_POST['saga_deal_week_name'];
                $settings['saga_deal_week_link'] = $_POST['saga_deal_week_link'];
                $settings['saga_post_gallery'] = $_POST['saga_post_gallery'];
                break;
            case 'footer':
                $settings['saga_ga'] = $_POST['saga_ga'];
                break;
        }
    }
    if (!current_user_can('unfiltered_html')) {
        if ($settings['saga_ga']) {
            $settings['saga_ga'] = stripslashes(esc_textarea(wp_filter_post_kses($settings['saga_ga'])));
        }
        if ($settings['saga_intro']) {
            $settings['saga_intro'] = stripslashes(esc_textarea(wp_filter_post_kses($settings['saga_intro'])));
        }
    }
    $updated = update_option("saga_theme_settings", $settings);
}
开发者ID:nueue,项目名称:sagaplex,代码行数:33,代码来源:settings.php


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