コード例 #1
0
ファイル: admin.php プロジェクト: nemobis/wiki-embed
/**
 * 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 
}
コード例 #2
0
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>';
}
コード例 #3
0
    /**
     * 設定画面にフィールドを表示(オリジナル項目)
     *
     * @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 
    }
コード例 #4
0
 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>';
 }
コード例 #5
0
ファイル: textarea.php プロジェクト: Garth619/Femi9
 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;
 }
コード例 #6
0
    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 
    }
コード例 #7
0
ファイル: wp.sendMail.php プロジェクト: sachsy/snippets-1
/**
 * 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;
}
コード例 #8
0
ファイル: functions.php プロジェクト: estvmachine/nicowp
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;
}
コード例 #9
0
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>';
}
コード例 #10
0
ファイル: custom-controls.php プロジェクト: web-way/web-way
        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
        }
コード例 #11
0
ファイル: contact.php プロジェクト: KrissieV/LBC-multisite
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 = '*****@*****.**';
        $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>';
        }
    }
}
コード例 #12
0
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>';
}
コード例 #13
0
 /**
  * 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);
 }
コード例 #14
0
    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 
    }
コード例 #15
0
ファイル: settings.php プロジェクト: nueue/sagaplex
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);
}
コード例 #16
0
 function test_esc_textarea_charset_utf_8()
 {
     add_filter('pre_option_blog_charset', array($this, '_charset_utf_8'));
     $utf8 = 'Fran' . chr(195) . chr(167) . 'ais';
     $this->assertEquals($utf8, esc_textarea($utf8));
     remove_filter('pre_option_blog_charset', array($this, '_charset_utf_8'));
 }
コード例 #17
0
ファイル: manual.php プロジェクト: RJHanson292/WP-e-Commerce
    /**
     * Displays the setup form
     *
     * @access public
     * @since 3.9
     * @uses WPSC_Checkout_Form::get()
     * @uses WPSC_Checkout_Form::field_drop_down_options()
     * @uses WPSC_Checkout_Form::get_field_id_by_unique_name()
     * @uses WPSC_Payment_Gateway_Setting::get()
     *
     * @return void
     */
    public function setup_form()
    {
        ?>
		<tr>
			<td colspan="2">
				<p>
					<label for="wpsc-manual-gateway-setup"><?php 
        _e('Instructions', 'wpsc');
        ?>
</label><br />
					<textarea id="wpsc-manual-gateway-setup" cols='' rows='10' name='<?php 
        echo esc_attr($this->setting->get_field_name('payment_instructions'));
        ?>
'><?php 
        echo esc_textarea(wp_unslash($this->setting->get('payment_instructions')));
        ?>
</textarea><br />
					<small><?php 
        _e('Enter the payment instructions that you wish to display to your customers when they make a purchase.', 'wpsc');
        ?>
</small><br />
					<small><?php 
        _e('For example, this is where you the Shop Owner might enter your bank account details or address so that your customer can make their manual payment.', 'wpsc');
        ?>
</small>
				</p>
			</td>
		</tr>
		<?php 
    }
コード例 #18
0
    public function form($instance)
    {
        $instance = wp_parse_args((array) $instance, array('title' => __('Contacts', 'prodo'), 'text' => '', 'phone' => '', 'location' => '', 'email' => ''));
        $title = strip_tags($instance['title']);
        $text = esc_textarea($instance['text']);
        $phone = strip_tags($instance['phone']);
        $location = strip_tags($instance['location']);
        $email = strip_tags($instance['email']);
        echo '
		<p>
			<label for="' . $this->get_field_id('title') . '">' . __('Title:', 'prodo') . '</label> 
			<input class="widefat" id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" type="text" value="' . esc_attr($title) . '" />
		</p>
		<textarea class="widefat" rows="6" cols="20" id="' . $this->get_field_id('text') . '" name="' . $this->get_field_name('text') . '">' . $text . '</textarea>
		<p>
			<label for="' . $this->get_field_id('phone') . '">' . __('Phone:', 'prodo') . '</label> 
			<input class="widefat" id="' . $this->get_field_id('phone') . '" name="' . $this->get_field_name('phone') . '" type="text" value="' . esc_attr($phone) . '" />
		</p>
		<p>
			<label for="' . $this->get_field_id('location') . '">' . __('Location:', 'prodo') . '</label> 
			<input class="widefat" id="' . $this->get_field_id('location') . '" name="' . $this->get_field_name('location') . '" type="text" value="' . esc_attr($location) . '" />
		</p>
		<p>
			<label for="' . $this->get_field_id('email') . '">' . __('Email:', 'prodo') . '</label> 
			<input class="widefat" id="' . $this->get_field_id('email') . '" name="' . $this->get_field_name('email') . '" type="text" value="' . esc_attr($email) . '" />
		</p>
		<p>
			<input class="checkbox" id="' . $this->get_field_id('location_as_url') . '" name="' . $this->get_field_name('location_as_url') . '" type="checkbox" ' . checked(isset($instance['location_as_url']) ? $instance['location_as_url'] : 0, true, false) . ' />
			<label for="' . $this->get_field_id('location_as_url') . '">' . __('Display Location as link', 'prodo') . '</label><br>

			<input class="checkbox" id="' . $this->get_field_id('email_as_url') . '" name="' . $this->get_field_name('email_as_url') . '" type="checkbox" ' . checked(isset($instance['email_as_url']) ? $instance['email_as_url'] : 0, true, false) . '>
			<label for="' . $this->get_field_id('email_as_url') . '">' . __('Display Email as link', 'prodo') . '</label>
		</p>';
    }
コード例 #19
0
 /**
  * Settings Page
  * Outputs a textarea for setting 'scripts_in_head'.
  */
 static function textarea($args)
 {
     extract($args);
     $options = get_option($setting);
     $value = isset($options[$label_for]) ? $options[$label_for] : '';
     $output = '';
     if (isset($wrap_class)) {
         $output .= '<div class="' . $wrap_class . '">';
     }
     $output .= '<textarea';
     $output .= $style ? ' style="' . $style . '"' : '';
     $output .= $class ? ' class="' . $class . '"' : '';
     $output .= $rows ? ' rows="' . $rows . '"' : '';
     $output .= $cols ? ' cols="' . $cols . '"' : '';
     $output .= ' name="' . $setting . '[' . $label_for . ']"';
     $output .= ' id="' . $label_for . '">';
     $output .= esc_textarea($value) . '</textarea>';
     if (isset($wrap_class)) {
         $output .= '</div>';
     }
     if ($description) {
         $output .= $description;
     }
     echo $output;
 }
コード例 #20
0
/**
 * Callback for in-post scripts meta box.
 *
 * Echoes out HTML.
 *
 * @category Genesis
 * @package Admin
 * @subpackage Inpost-Metaboxes
 *
 */
function gs_inpost_scripts_box()
{
    wp_nonce_field('gs_inpost_scripts_save', 'gs_inpost_scripts_nonce');
    ?>
	
	<p><label for="genesis_redirect"><b><?php 
    _e('Custom Redirect URI', 'genesis');
    ?>
</b> <a href="http://www.google.com/support/webmasters/bin/answer.py?hl=en&amp;answer=93633" target="_blank" title="301 Redirect">[?]</a></label></p>
	<p><input class="large-text" type="text" name="genesis_scripts[redirect]" id="genesis_redirect" value="<?php 
    echo esc_url(genesis_get_custom_field('redirect'));
    ?>
" /></p>
	
	<p><label for="genesis_header_scripts"><b><?php 
    _e('Scripts', 'genesis');
    ?>
</b></label></p>
	<p><textarea class="large-text" rows="4" cols="6" name="genesis_scripts[_genesis_scripts]" id="genesis_header_scripts"><?php 
    echo esc_textarea(genesis_get_custom_field('_genesis_scripts'));
    ?>
</textarea></p>
	
	<p><label for="genesis_footer_scripts"><b><?php 
    _e('Footer Scripts', 'genesis');
    ?>
</b></label></p>
	<p><textarea class="large-text" rows="4" cols="6" name="genesis_scripts[_genesis_footer_scripts]" id="genesis_footer_scripts"><?php 
    echo esc_textarea(genesis_get_custom_field('_genesis_footer_scripts'));
    ?>
</textarea></p>
	<?php 
}
コード例 #21
0
    /**
     * Render the content on the theme customizer page
     */
    public function render_content()
    {
        ?>

		<label>
			<?php 
        if (!empty($this->label)) {
            ?>
				<span class="customize-control-title"><?php 
            echo esc_html($this->label);
            ?>
</span>
			<?php 
        }
        ?>
			<input type="hidden" <?php 
        $this->link();
        ?>
 value="<?php 
        echo esc_textarea($this->value());
        ?>
" id="<?php 
        echo $this->id;
        ?>
" class="editorfield">
			<a onclick="javascript:WPEditorWidget.showEditor('<?php 
        echo $this->id;
        ?>
');" class="button edit-content-button"><?php 
        _e('Edit content', 'optimizer');
        ?>
</a>
		</label>
		<?php 
    }
コード例 #22
0
ファイル: editor.class.php プロジェクト: alenteria/vitrari
    protected function render_field($value, $instance)
    {
        ?>
		<textarea type="text" name="<?php 
        echo esc_attr($this->element_name);
        ?>
" id="<?php 
        echo esc_attr($this->element_id);
        ?>
"
			<?php 
        if (!empty($this->placeholder)) {
            echo 'placeholder="' . esc_attr($this->placeholder) . '"';
        }
        ?>
			<?php 
        $this->render_CSS_classes($this->get_input_classes());
        ?>
			      rows="<?php 
        echo !empty($this->rows) ? intval($this->rows) : 4;
        ?>
"
			<?php 
        if (!empty($this->readonly)) {
            echo 'readonly';
        }
        ?>
><?php 
        echo esc_textarea($value);
        ?>
</textarea>
		<?php 
    }
コード例 #23
0
    public function render_content()
    {
        ?>

		<label>
			<span class="customize-control-title"><?php 
        echo $this->label;
        ?>
</span>
			<?php 
        if ($this->description) {
            ?>
<span class="description customize-control-description"><?php 
            echo $this->description;
            ?>
</span><?php 
        }
        ?>
			<textarea name="<?php 
        echo $this->id;
        ?>
" cols="20" rows="4" <?php 
        $this->link();
        ?>
><?php 
        echo esc_textarea($this->value());
        ?>
</textarea>
		</label>

		<?php 
    }
コード例 #24
0
function Grafik_MetaScripts_Callback($entry)
{
    // Get Stored Meta Values...
    $PREFILL = array('grafik-meta-headscripts-noglobal' => (int) get_post_meta($entry->ID, 'grafik-meta-headscripts-noglobal', true), 'grafik-meta-headscripts-notype' => (int) get_post_meta($entry->ID, 'grafik-meta-headscripts-notype', true), 'grafik-meta-headscripts' => stripslashes(esc_textarea(base64_decode(get_post_meta($entry->ID, 'grafik-meta-headscripts', true)))), 'grafik-meta-bodyscripts-noglobal' => (int) get_post_meta($entry->ID, 'grafik-meta-bodyscripts-noglobal', true), 'grafik-meta-bodyscripts-notype' => (int) get_post_meta($entry->ID, 'grafik-meta-bodyscripts-notype', true), 'grafik-meta-bodyscripts' => stripslashes(esc_textarea(base64_decode(get_post_meta($entry->ID, 'grafik-meta-bodyscripts', true)))));
    // Output Meta Controls...
    echo '<div class="grafik-metabox">' . wp_nonce_field('grafik-nonce-metascripts', 'grafik-nonce-metascripts', true, false) . '<table>' . '<td style="width:50%">' . '<strong>Head Scripts:</strong>' . '<p>Head scripts are scripts that exist inside the &lt;head&gt; tag. Some scripts require being placed here. By default, posts and pages inherit the global and corresponding type head scripts. If you wish to not use these assets for this post/page, you can disable them here.</p>' . '<p>' . '<input type="checkbox" name="grafik-meta-headscripts-noglobal" id="grafik-meta-headscripts-noglobal" ' . ($PREFILL['grafik-meta-headscripts-noglobal'] == 1 ? 'checked="checked"' : null) . '/>' . '<label for="grafik-meta-headscripts-noglobal">Do Not Use Global Head Scripts</label>' . '</p>' . '<p>' . '<input type="checkbox" name="grafik-meta-headscripts-notype" id="grafik-meta-headscripts-notype" ' . ($PREFILL['grafik-meta-headscripts-notype'] == 1 ? 'checked="checked"' : null) . '/>' . '<label for="grafik-meta-headscripts-notype">Do Not Use Type Head Scripts</label>' . '</p>' . '<p><textarea name="grafik-meta-headscripts">' . $PREFILL['grafik-meta-headscripts'] . '</textarea></p>' . '</td>' . '<td style="width:50%">' . '<strong>Body Scripts:</strong>' . '<p>Body scripts are scripts that exist right before the &lt;/body&gt; tag. Some scripts require being placed here. By default, posts and pages inherit the global and corresponding type body scripts. If you wish to not use these assets for this post/page, you can disable them here.</p>' . '<p>' . '<input type="checkbox" name="grafik-meta-bodyscripts-noglobal" id="grafik-meta-bodyscripts-noglobal" ' . ($PREFILL['grafik-meta-bodyscripts-noglobal'] == 1 ? 'checked="checked"' : null) . '/>' . '<label for="grafik-meta-bodyscripts-noglobal">Do Not Use Global Body Scripts</label>' . '</p>' . '<p>' . '<input type="checkbox" name="grafik-meta-bodyscripts-notype" id="grafik-meta-bodyscripts-notype" ' . ($PREFILL['grafik-meta-bodyscripts-notype'] == 1 ? 'checked="checked"' : null) . '/>' . '<label for="grafik-meta-bodyscripts-notype">Do Not Use Type Body Scripts</label>' . '</p>' . '<p><textarea name="grafik-meta-bodyscripts">' . $PREFILL['grafik-meta-bodyscripts'] . '</textarea></p>' . '</td>' . '</table>' . '</div>';
}
コード例 #25
0
    /**
     * Output the field.
     *
     * @param int $user_id
     */
    public function output($user_id)
    {
        $value = $user_id > 0 ? get_user_meta($user_id, $this->name, true) : '';
        switch ($this->type) {
            case 'textarea':
                ?>
				<tr>
					<th><label><?php 
                echo $this->label;
                ?>
</label></th>
					<td>
						<textarea name="<?php 
                echo esc_attr($this->name);
                ?>
"><?php 
                echo esc_textarea($value);
                ?>
</textarea>
					</td>
				</tr>
				<?php 
                break;
        }
    }
コード例 #26
0
 /**
  * Render the shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render($args, $content = '')
 {
     $defaults = Magee_Core::set_shortcode_defaults(array('id' => '', 'class' => '', 'percent' => '50', 'text' => '', 'height' => 30, 'color' => '', 'direction' => 'left', 'textposition' => 'on', 'number' => 'yes', 'rounded' => 'on', 'striped' => 'none'), $args);
     extract($defaults);
     self::$args = $defaults;
     $percent = str_replace('%', '', $percent);
     $percent = esc_attr($percent) . '%';
     $css_style = 'width: ' . esc_attr($percent) . ';';
     if (is_numeric($height)) {
         $height = $height . 'px';
     }
     $line_height = '';
     $bar_height = '';
     if ($height) {
         $bar_height = 'height:' . esc_attr($height) . ';';
         $line_height = 'line-height:' . esc_attr($height) . '';
     }
     if ($direction == 'left') {
         $a = 'left';
         $b = 'right';
     } else {
         $a = 'right';
         $b = 'left';
     }
     $progress = '';
     $progress_bar = '';
     if ($textposition == 'above') {
         $progress .= ' progress-sm';
     }
     if ($number == 'no') {
         $percent = '';
     }
     if ($rounded == 'on') {
         $progress .= ' rounded';
     }
     if ($striped == 'none') {
         $progress_bar .= ' none-striped';
     }
     if ($striped == 'striped') {
         $progress_bar .= ' progress-bar-striped';
     }
     if ($striped == 'striped animated') {
         $progress_bar .= ' progress-bar-striped animated hinge infinite';
     }
     if ($color) {
         $css_style .= 'background-color:' . esc_attr($color) . ';';
     }
     $html = '<div class="magee-progress-box ' . esc_attr($class) . '" id="' . esc_attr($id) . '">';
     if ($textposition == '2') {
         $html .= '<div class="porgress-title text-' . $a . ' clearfix">' . esc_textarea($text) . ' <div class="pull-' . $b . '">' . esc_attr($percent) . '</div></div>';
     }
     $html .= '<div class="progress ' . $progress . '" style="' . $bar_height . '">
                                                 <div class="progress-bar pull-' . $a . ' ' . esc_attr($progress_bar) . '" role="progressbar" aria-valuenow="' . esc_textarea($text) . '" aria-valuemin="0" aria-valuemax="100" style="' . $css_style . '">';
     if ($textposition == '1') {
         $html .= '<div class="progress-title text-' . $a . ' clearfix" style="' . $line_height . '">' . esc_textarea($text) . ' <div class="pull-' . $b . '">' . esc_attr($percent) . '</div></div>';
     }
     $html .= ' </div></div>';
     $html .= '</div>';
     return $html;
 }
 protected function getField($aField)
 {
     $_aInputAttributes = $aField['attributes'];
     $_aInputAttributes['class'] .= ' system';
     unset($_aInputAttributes['value']);
     return $aField['before_label'] . "<div class='admin-page-framework-input-label-container'>" . "<label for='{$aField['input_id']}'>" . $aField['before_input'] . ($aField['label'] && !$aField['repeatable'] ? "<span class='admin-page-framework-input-label-string' style='min-width:" . $this->sanitizeLength($aField['label_min_width']) . ";'>" . $aField['label'] . "</span>" : "") . "<textarea " . $this->getAttributes($_aInputAttributes) . " >" . esc_textarea($this->_getSystemInfomation($aField['value'], $aField['data'], $aField['print_type'])) . "</textarea>" . $aField['after_input'] . "</label>" . "</div>" . $aField['after_label'];
 }
コード例 #28
0
    public function render_content()
    {
        ?>
		<label>
			<?php 
        // The label has already been sanitized in the Fields class, no need to re-sanitize it.
        ?>
			<span class="customize-control-title"><?php 
        echo $this->label;
        ?>
</span>
			<input type="text" data-palette="<?php 
        echo esc_textarea($this->palette);
        ?>
" data-default-color="<?php 
        echo $this->default;
        ?>
" value="<?php 
        echo intval($this->value());
        ?>
" class="kirki-color-control" <?php 
        $this->link();
        ?>
  />
		</label>
	<?php 
    }
コード例 #29
0
ファイル: description.php プロジェクト: RuseHackV2/Go-Out
function wppb_description_handler($output, $form_location, $field, $user_id, $field_check_errors, $request_data)
{
    $item_title = apply_filters('wppb_' . $form_location . '_description_item_title', wppb_icl_t('plugin profile-builder-pro', 'default_field_' . $field['id'] . '_title_translation', $field['field-title']));
    $item_description = wppb_icl_t('plugin profile-builder-pro', 'default_field_' . $field['id'] . '_description_translation', $field['description']);
    $input_value = '';
    if ($form_location == 'edit_profile') {
        $input_value = get_the_author_meta('description', $user_id);
    }
    if (trim($input_value) == '') {
        $input_value = $field['default-value'];
    }
    $input_value = isset($request_data['description']) ? trim($request_data['description']) : $input_value;
    $extra_attr = apply_filters('wppb_extra_attribute', '', $field);
    if ($form_location != 'back_end') {
        $error_mark = $field['required'] == 'Yes' ? '<span class="wppb-required" title="' . wppb_required_field_error($field["field-title"]) . '">*</span>' : '';
        if (array_key_exists($field['id'], $field_check_errors)) {
            $error_mark = '<img src="' . WPPB_PLUGIN_URL . 'assets/images/pencil_delete.png" title="' . wppb_required_field_error($field["field-title"]) . '"/>';
        }
        $output = '
			<label for="description">' . $item_title . $error_mark . '</label>
			<textarea rows="' . $field['row-count'] . '" name="description" maxlength="' . apply_filters('wppb_maximum_character_length', '', $field) . '" class="default_field_description" id="description" wrap="virtual" ' . $extra_attr . '>' . esc_textarea(wp_unslash($input_value)) . '</textarea>';
        if (!empty($item_description)) {
            $output .= '<span class="wppb-description-delimiter">' . $item_description . '</span>';
        }
    }
    return apply_filters('wppb_' . $form_location . '_description', $output, $form_location, $field, $user_id, $field_check_errors, $request_data);
}
コード例 #30
-1
function ajax_contact_form()
{
    $response = array();
    $navn = isset($_POST['navn']) ? wp_strip_all_tags($_POST['navn']) : false;
    $email = isset($_POST['email']) ? wp_strip_all_tags($_POST['email']) : false;
    $firma = isset($_POST['firma']) ? wp_strip_all_tags($_POST['firma']) : false;
    $telefon = isset($_POST['telefon']) ? wp_strip_all_tags($_POST['telefon']) : false;
    $about = isset($_POST['about']) ? wp_strip_all_tags($_POST['about']) : false;
    $kommentar = isset($_POST['kommentar']) ? esc_textarea($_POST['kommentar']) : false;
    if (!$navn) {
        $response['error'] = 'Indtast et navn';
    } else {
        if (!$email) {
            $response['error'] = 'Indtast en email';
        }
    }
    if (!isset($response['error'])) {
        $post_vars = array('post_title' => $navn . ' [' . $email . ']', 'post_status' => 'publish', 'post_type' => 'form');
        $response['post_id'] = wp_insert_post($post_vars, true);
        if (is_wp_error($response['post_id'])) {
            $response['error'] = $return->get_error_message();
        }
    }
    if (!isset($response['error'])) {
        update_post_meta($response['post_id'], 'form_navn', $navn);
        update_post_meta($response['post_id'], 'form_email', $email);
        update_post_meta($response['post_id'], 'form_firma', $firma);
        update_post_meta($response['post_id'], 'form_telefon', $telefon);
        update_post_meta($response['post_id'], 'form_about', $about);
        update_post_meta($response['post_id'], 'form_kommentar', $kommentar);
        $response['success'] = '<article><h2>Tak for din henvendelse</h2><p>Vi vil besvare den hurtigst muligt.</p><article>';
        sendEmail(get_theme_mod('info_name'), get_theme_mod('info_email'), get_theme_mod('info_email'), 'Ny henvendelse fra ' . $navn, $kommentar);
    }
    wp_die(json_encode($response));
}