本文整理汇总了PHP中wp_richedit_pre函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_richedit_pre函数的具体用法?PHP wp_richedit_pre怎么用?PHP wp_richedit_pre使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_richedit_pre函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: test_wp_richedit_pre_charset_utf_8
function test_wp_richedit_pre_charset_utf_8()
{
add_filter('pre_option_blog_charset', array($this, '_charset_utf_8'));
$utf8 = 'Fran' . chr(195) . chr(167) . 'ais';
$this->assertEquals('<p>' . $utf8 . "</p>\n", wp_richedit_pre($utf8));
remove_filter('pre_option_blog_charset', array($this, '_charset_utf_8'));
}
开发者ID:boonebgorges,项目名称:develop.wordpress,代码行数:7,代码来源:WpRichEditPre.php
示例2: copy_from_original_fields
/**
* Gets the content of a post, its excerpt as well as its title and returns it as an array
*
* @param string $content_type
* @param string $excerpt_type
* @param int $trid
* @param string $lang
*
* @return array containing all the fields information
*/
public static function copy_from_original_fields($content_type, $excerpt_type, $trid, $lang)
{
global $wpdb;
$post_id = $wpdb->get_var($wpdb->prepare("SELECT element_id FROM {$wpdb->prefix}icl_translations WHERE trid=%d AND language_code=%s", $trid, $lang));
$post = get_post($post_id);
$fields_to_copy = array('content' => 'post_content', 'title' => 'post_title', 'excerpt' => 'post_excerpt');
$fields_contents = array();
if (!empty($post)) {
foreach ($fields_to_copy as $editor_key => $editor_field) {
//loops over the three fields to be inserted into the array
if ($editor_key === 'content' || $editor_key === 'excerpt') {
//
if ($editor_key === 'content') {
$editor_var = $content_type;
//these variables are supplied by a javascript call in scripts.js icl_copy_from_original(lang, trid)
} elseif ($editor_key === 'excerpt') {
$editor_var = $excerpt_type;
}
if ($editor_var === 'rich') {
$html_pre = wp_richedit_pre($post->{$editor_field});
} else {
$html_pre = wp_htmledit_pre($post->{$editor_field});
}
$fields_contents[$editor_key] = htmlspecialchars_decode($html_pre);
} elseif ($editor_key === 'title') {
$fields_contents[$editor_key] = strip_tags($post->{$editor_field});
}
}
$fields_contents['customfields'] = apply_filters('wpml_copy_from_original_custom_fields', self::copy_from_original_custom_fields($post));
} else {
$fields_contents['error'] = __('Post not found', 'sitepress');
}
do_action('icl_copy_from_original', $post_id);
return $fields_contents;
}
开发者ID:edgarter,项目名称:wecare,代码行数:45,代码来源:wpml-post-edit-ajax.class.php
示例3: html
function html($field)
{
echo '<div class="acf_wysiwyg">';
?>
<div id="editor-toolbar" style="display:none;">
<div id="media-buttons">
Upload/Insert <a title="Add an Image" class="thickbox" id="add_image" href="media-upload.php?post_id=1802&type=image&TB_iframe=1&width=640&height=314"><img onclick="return false;" alt="Add an Image" src="http://localhost:8888/acf/wp-admin/images/media-button-image.gif?ver=20100531"></a><a title="Add Video" class="thickbox" id="add_video" href="media-upload.php?post_id=1802&type=video&TB_iframe=1&width=640&height=314"><img onclick="return false;" alt="Add Video" src="http://localhost:8888/acf/wp-admin/images/media-button-video.gif?ver=20100531"></a><a title="Add Audio" class="thickbox" id="add_audio" href="media-upload.php?post_id=1802&type=audio&TB_iframe=1&width=640&height=314"><img onclick="return false;" alt="Add Audio" src="http://localhost:8888/acf/wp-admin/images/media-button-music.gif?ver=20100531"></a><a title="Add Media" class="thickbox" id="add_media" href="media-upload.php?post_id=1802&TB_iframe=1&width=640&height=314"><img onclick="return false;" alt="Add Media" src="http://localhost:8888/acf/wp-admin/images/media-button-other.gif?ver=20100531"></a> </div>
</div>
<?php
echo '<div id="editorcontainer"><textarea name="' . $field->input_name . '" >';
echo wp_richedit_pre($field->value);
echo '</textarea></div></div>';
}
开发者ID:besimhu,项目名称:legacy,代码行数:14,代码来源:wysiwyg.php
示例4: get_field
/**
* 投稿画面にフィールドを表示
*
* @param int $index インデックス番号
* @param mixed $value 保存されている値(check のときだけ配列)
* @return string html
*/
public function get_field($index, $value)
{
$name = $this->get_field_name_in_editor($index);
$disabled = $this->get_disable_attribute($index);
if (function_exists('format_for_editor')) {
$value = format_for_editor($value);
} else {
$value = wp_richedit_pre($value);
}
return sprintf('<div class="wp-editor-wrap">
<div class="wp-editor-tools hide-if-no-js">
<div class="wp-media-buttons">%s</div>
</div>
<div class="wp-editor-container">
<textarea name="%s" rows="8" class="widefat smart-cf-wp-editor" %s>%s</textarea>
</div>
</div>', $this->media_buttons(), esc_attr($name), disabled(true, $disabled, false), $value);
}
开发者ID:hiroki-tkg,项目名称:bitmaker,代码行数:25,代码来源:class.field-wysiwyg.php
示例5: spyropress_widget_editor
function spyropress_widget_editor($item, $id, $value, $is_builder = false)
{
ob_start();
// collecting attributes
$atts = array();
$atts['class'] = 'field builder-rich-text';
$atts['id'] = esc_attr($id);
$atts['name'] = esc_attr($item['name']);
$atts['rows'] = esc_attr($item['rows']);
echo '<div ' . build_section_class('section-editor section-full', $item) . '>';
build_heading($item, true);
build_description($item);
echo '<div class="controls">';
printf('<textarea %s>%s</textarea>', spyropress_build_atts($atts), wp_richedit_pre($value));
echo '</div>';
echo '</div>';
$ui_content = ob_get_clean();
return $ui_content;
}
开发者ID:rinodung,项目名称:myfreetheme,代码行数:19,代码来源:text-editor.php
示例6: get_post
}
}
if (isset($iclsettings)) {
$this->save_settings($iclsettings);
}
}
echo '1|';
break;
case 'copy_from_original':
$post_id = $wpdb->get_var($wpdb->prepare("SELECT element_id FROM {$wpdb->prefix}icl_translations WHERE trid=%d AND language_code=%s", $_POST['trid'], $_POST['lang']));
$post = get_post($post_id);
$error = false;
$json = array();
if (!empty($post)) {
if ($_POST['editor_type'] == 'rich') {
$json['body'] = htmlspecialchars_decode(wp_richedit_pre($post->post_content));
} else {
$json['body'] = htmlspecialchars_decode(wp_htmledit_pre($post->post_content));
}
} else {
$json['error'] = __('Post not found', 'sitepress');
}
do_action('icl_copy_from_original', $post_id);
echo json_encode($json);
break;
case 'save_user_preferences':
$user_preferences = $this->get_user_preferences();
$this->set_user_preferences(array_merge_recursive($user_preferences, $_POST['user_preferences']));
$this->save_user_preferences();
break;
case 'wpml_cf_translation_preferences':
开发者ID:sedici,项目名称:wpmu-istec,代码行数:31,代码来源:ajax.php
示例7: the_quicktags
if ($rows < 3 || $rows > 100) {
$rows = 12;
}
the_quicktags();
?>
<div><textarea <?php
if (user_can_richedit()) {
echo 'title="true" ';
}
?>
rows="<?php
echo $rows;
?>
" cols="40" name="content" tabindex="2" id="content"><?php
echo user_can_richedit() ? wp_richedit_pre($post->post_content) : $post->post_content;
?>
</textarea></div>
</fieldset>
<script type="text/javascript">
<!--
edCanvas = document.getElementById('content');
<?php
if (user_can_richedit()) {
?>
// This code is meant to allow tabbing from Title to Post (TinyMCE).
if ( tinyMCE.isMSIE )
document.getElementById('title').onkeydown = function (e)
{
e = e ? e : window.event;
开发者ID:robertlange81,项目名称:Website,代码行数:31,代码来源:edit-form-advanced.php
示例8: save
/**
* Actions to save, update, and delete forms/form fields
*
*
* @since 1.0
*/
public function save()
{
global $wpdb;
if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'visual-form-builder' && isset($_REQUEST['action'])) {
switch ($_REQUEST['action']) {
case 'create_form':
$form_id = absint($_REQUEST['form_id']);
$form_key = sanitize_title($_REQUEST['form_title']);
$form_title = esc_html($_REQUEST['form_title']);
check_admin_referer('create_form-' . $form_id);
$newdata = array('form_key' => $form_key, 'form_title' => $form_title);
/* Set message to display */
$this->message = sprintf(__('<div id="message" class="updated"><p>The <strong>%s</strong> form has been created.</p></div>', 'visual-form-builder'), $form_title);
/* Create the form */
$wpdb->insert($this->form_table_name, $newdata);
/* Get form ID to add our first field */
$new_form_selected = $wpdb->insert_id;
/* Setup the initial fieldset */
$initial_fieldset = array('form_id' => $wpdb->insert_id, 'field_key' => 'fieldset', 'field_type' => 'fieldset', 'field_name' => 'Fieldset', 'field_sequence' => 0);
/* Add the first fieldset to get things started */
$wpdb->insert($this->field_table_name, $initial_fieldset);
$verification_fieldset = array('form_id' => $new_form_selected, 'field_key' => 'verification', 'field_type' => 'verification', 'field_name' => 'Verification', 'field_description' => '(This is for preventing spam)', 'field_sequence' => 1);
/* Insert the submit field */
$wpdb->insert($this->field_table_name, $verification_fieldset);
$verify_fieldset_parent_id = $wpdb->insert_id;
$secret = array('form_id' => $new_form_selected, 'field_key' => 'secret', 'field_type' => 'secret', 'field_name' => 'Please enter any two digits with no spaces (Example: 12)', 'field_size' => 'medium', 'field_required' => 'yes', 'field_parent' => $verify_fieldset_parent_id, 'field_sequence' => 2);
/* Insert the submit field */
$wpdb->insert($this->field_table_name, $secret);
/* Make the submit last in the sequence */
$submit = array('form_id' => $new_form_selected, 'field_key' => 'submit', 'field_type' => 'submit', 'field_name' => 'Submit', 'field_parent' => $verify_fieldset_parent_id, 'field_sequence' => 3);
/* Insert the submit field */
$wpdb->insert($this->field_table_name, $submit);
/* Redirect to keep the URL clean (use AJAX in the future?) */
wp_redirect('options-general.php?page=visual-form-builder&form=' . $new_form_selected);
exit;
break;
case 'update_form':
$form_id = absint($_REQUEST['form_id']);
$form_key = sanitize_title($_REQUEST['form_title'], $form_id);
$form_title = esc_html($_REQUEST['form_title']);
$form_subject = esc_html($_REQUEST['form_email_subject']);
$form_to = serialize(array_map('esc_html', $_REQUEST['form_email_to']));
$form_from = esc_html($_REQUEST['form_email_from']);
$form_from_name = esc_html($_REQUEST['form_email_from_name']);
$form_from_override = esc_html($_REQUEST['form_email_from_override']);
$form_from_name_override = esc_html($_REQUEST['form_email_from_name_override']);
$form_success_type = esc_html($_REQUEST['form_success_type']);
$form_notification_setting = esc_html($_REQUEST['form_notification_setting']);
$form_notification_email_name = esc_html($_REQUEST['form_notification_email_name']);
$form_notification_email_from = esc_html($_REQUEST['form_notification_email_from']);
$form_notification_email = esc_html($_REQUEST['form_notification_email']);
$form_notification_subject = esc_html($_REQUEST['form_notification_subject']);
$form_notification_message = wp_richedit_pre($_REQUEST['form_notification_message']);
$form_notification_entry = esc_html($_REQUEST['form_notification_entry']);
$form_label_alignment = esc_html($_REQUEST['form_label_alignment']);
/* Add confirmation based on which type was selected */
switch ($form_success_type) {
case 'text':
$form_success_message = wp_richedit_pre($_REQUEST['form_success_message_text']);
break;
case 'page':
$form_success_message = esc_html($_REQUEST['form_success_message_page']);
break;
case 'redirect':
$form_success_message = esc_html($_REQUEST['form_success_message_redirect']);
break;
}
check_admin_referer('update_form-' . $form_id);
$newdata = array('form_key' => $form_key, 'form_title' => $form_title, 'form_email_subject' => $form_subject, 'form_email_to' => $form_to, 'form_email_from' => $form_from, 'form_email_from_name' => $form_from_name, 'form_email_from_override' => $form_from_override, 'form_email_from_name_override' => $form_from_name_override, 'form_success_type' => $form_success_type, 'form_success_message' => $form_success_message, 'form_notification_setting' => $form_notification_setting, 'form_notification_email_name' => $form_notification_email_name, 'form_notification_email_from' => $form_notification_email_from, 'form_notification_email' => $form_notification_email, 'form_notification_subject' => $form_notification_subject, 'form_notification_message' => $form_notification_message, 'form_notification_entry' => $form_notification_entry, 'form_label_alignment' => $form_label_alignment);
$where = array('form_id' => $form_id);
/* Update form details */
$wpdb->update($this->form_table_name, $newdata, $where);
/* Initialize field sequence */
$field_sequence = 0;
/* Loop through each field and update all at once */
if (!empty($_REQUEST['field_id'])) {
foreach ($_REQUEST['field_id'] as $id) {
$field_name = isset($_REQUEST['field_name-' . $id]) ? esc_html($_REQUEST['field_name-' . $id]) : '';
$field_key = sanitize_title($field_name, $id);
$field_desc = isset($_REQUEST['field_description-' . $id]) ? esc_html($_REQUEST['field_description-' . $id]) : '';
$field_options = isset($_REQUEST['field_options-' . $id]) ? serialize(array_map('esc_html', $_REQUEST['field_options-' . $id])) : '';
$field_validation = isset($_REQUEST['field_validation-' . $id]) ? esc_html($_REQUEST['field_validation-' . $id]) : '';
$field_required = isset($_REQUEST['field_required-' . $id]) ? esc_html($_REQUEST['field_required-' . $id]) : '';
$field_size = isset($_REQUEST['field_size-' . $id]) ? esc_html($_REQUEST['field_size-' . $id]) : '';
$field_css = isset($_REQUEST['field_css-' . $id]) ? esc_html($_REQUEST['field_css-' . $id]) : '';
$field_layout = isset($_REQUEST['field_layout-' . $id]) ? esc_html($_REQUEST['field_layout-' . $id]) : '';
$field_default = isset($_REQUEST['field_default-' . $id]) ? esc_html($_REQUEST['field_default-' . $id]) : '';
$field_data = array('field_key' => $field_key, 'field_name' => $field_name, 'field_description' => $field_desc, 'field_options' => $field_options, 'field_validation' => $field_validation, 'field_required' => $field_required, 'field_size' => $field_size, 'field_css' => $field_css, 'field_layout' => $field_layout, 'field_sequence' => $field_sequence, 'field_default' => $field_default);
$where = array('form_id' => $_REQUEST['form_id'], 'field_id' => $id);
/* Update all fields */
$wpdb->update($this->field_table_name, $field_data, $where);
$field_sequence++;
}
/* Check if a submit field type exists for backwards compatibility upgrades */
//.........这里部分代码省略.........
开发者ID:NUTV,项目名称:nutvca,代码行数:101,代码来源:visual-form-builder.php
示例9: format_value_for_input
/**
* Filter the field value to appear within the input as expected
* @param string $value The field value
* @param Attachments_field $field The field object
* @return string The formatted value
*/
function format_value_for_input($value, $field = null)
{
return wp_richedit_pre($value);
}
开发者ID:santikrass,项目名称:apache,代码行数:10,代码来源:class.field.wysiwyg.php
示例10: user_can_richedit
<div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo $post->post_title; ?>" id="title" /></div>
</fieldset>
<fieldset id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>">
<legend><?php _e('Post') ?></legend>
<?php
$rows = get_settings('default_post_edit_rows');
if (($rows < 3) || ($rows > 100)) {
$rows = 12;
}
?>
<?php the_quicktags(); ?>
</fieldset>
<div><textarea <?php if ( user_can_richedit() ) echo 'title="true" '; ?>rows="<?php echo $rows; ?>" cols="40" name="content" tabindex="2" id="content"><?php echo user_can_richedit() ? wp_richedit_pre($post->post_content) : $post->post_content; ?></textarea></div>
</fieldset>
<script type="text/javascript">
// <![CDATA[
edCanvas = document.getElementById('content');
<?php if ( user_can_richedit() ) : ?>
// This code is meant to allow tabbing from Title to Post (TinyMCE).
if ( tinyMCE.isMSIE )
document.getElementById('title').onkeydown = function (e)
{
e = e ? e : window.event;
if (e.keyCode == 9 && !e.shiftKey && !e.controlKey && !e.altKey) {
var i = tinyMCE.selectedInstance;
if(typeof i == 'undefined')
return true;
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:31,代码来源:edit-form-advanced.php
示例11: create_field
function create_field($field)
{
// vars
$field['toolbar'] = isset($field['toolbar']) ? $field['toolbar'] : 'full';
$field['media_upload'] = isset($field['media_upload']) ? $field['media_upload'] : 'yes';
$id = 'wysiwyg-' . $field['name'];
?>
<div id="wp-<?php
echo $id;
?>
-wrap" class="acf_wysiwyg wp-editor-wrap" data-toolbar="<?php
echo $field['toolbar'];
?>
">
<?php
if ($field['media_upload'] == 'yes') {
?>
<?php
if (get_bloginfo('version') < "3.3") {
?>
<div id="editor-toolbar">
<div id="media-buttons" class="hide-if-no-js">
<?php
do_action('media_buttons');
?>
</div>
</div>
<?php
} else {
?>
<div id="wp-<?php
echo $id;
?>
-editor-tools" class="wp-editor-tools">
<?php
/*<a onclick="switchEditors.switchto(this);" class="hide-if-no-js wp-switch-editor switch-html active" id="<?php echo $id; ?>-html">HTML</a>
<a onclick="switchEditors.switchto(this);" class="hide-if-no-js wp-switch-editor switch-tmce" id="<?php echo $id; ?>-tmce">Visual</a>*/
?>
<div id="wp-<?php
echo $id;
?>
-media-buttons" class="hide-if-no-js wp-media-buttons">
<?php
do_action('media_buttons');
?>
</div>
</div>
<?php
}
?>
<?php
}
?>
<div id="wp-<?php
echo $id;
?>
-editor-container" class="wp-editor-container">
<?php
/*<div id="qt_<?php echo $id; ?>_toolbar" class="quicktags-toolbar">
<input type="button" value="b" title="" class="ed_button" accesskey="b" id="qt_<?php echo $id; ?>_strong">
<input type="button" value="i" title="" class="ed_button" accesskey="i" id="qt_<?php echo $id; ?>_em">
<input type="button" value="link" title="" class="ed_button" accesskey="a" id="qt_<?php echo $id; ?>_link">
<input type="button" value="b-quote" title="" class="ed_button" accesskey="q" id="qt_<?php echo $id; ?>_block">
<input type="button" value="del" title="" class="ed_button" accesskey="d" id="qt_<?php echo $id; ?>_del">
<input type="button" value="ins" title="" class="ed_button" accesskey="s" id="qt_<?php echo $id; ?>_ins">
<input type="button" value="img" title="" class="ed_button" accesskey="m" id="qt_<?php echo $id; ?>_img">
<input type="button" value="ul" title="" class="ed_button" accesskey="u" id="qt_<?php echo $id; ?>_ul">
<input type="button" value="ol" title="" class="ed_button" accesskey="o" id="qt_<?php echo $id; ?>_ol">
<input type="button" value="li" title="" class="ed_button" accesskey="l" id="qt_<?php echo $id; ?>_li">
<input type="button" value="code" title="" class="ed_button" accesskey="c" id="qt_<?php echo $id; ?>_code">
<input type="button" value="more" title="" class="ed_button" accesskey="t" id="qt_<?php echo $id; ?>_more">
<input type="button" value="lookup" title="Dictionary lookup" class="ed_button" id="qt_<?php echo $id; ?>_spell">
<input type="button" value="close tags" title="Close all open tags" class="ed_button" id="qt_<?php echo $id; ?>_close">
<input type="button" value="fullscreen" title="Toggle fullscreen mode" class="ed_button" accesskey="f" id="qt_<?php echo $id; ?>_fullscreen">
</div>*/
?>
<textarea id="<?php
echo $id;
?>
" class="wp-editor-area" name="<?php
echo $field['name'];
?>
" ><?php
echo wp_richedit_pre($field['value']);
?>
</textarea>
</div>
</div>
<?php
//wp_editor('', $id);
?>
<?php
}
开发者ID:niko-lgdcom,项目名称:barrows,代码行数:94,代码来源:wysiwyg.php
示例12: render
function render()
{
$val = $this->get_value();
$id = 'wysiwyg-' . $this->get_name();
?>
<div id="wp-<?php
echo $id;
?>
-wrap" class="carbon-wysiwyg wp-editor-wrap tmce-active" data-toolbar="full">
<div id="wp-<?php
echo $id;
?>
-editor-tools" class="wp-editor-tools">
<div id="wp-<?php
echo $id;
?>
-media-buttons" class="hide-if-no-js wp-media-buttons">
<?php
do_action('media_buttons');
?>
</div>
</div>
<div class="wp-editor-tabs">
<a class="wp-switch-editor switch-html">Text</a>
<a class="wp-switch-editor switch-tmce">Visual</a>
</div>
<div id="wp-<?php
echo $id;
?>
-editor-container" class="wp-editor-container">
<textarea id="<?php
echo $id;
?>
" class="wp-editor-area" name="<?php
echo $this->get_name();
?>
" <?php
echo $this->required ? 'data-carbon-required="true"' : '';
?>
><?php
echo wp_richedit_pre($val);
?>
</textarea>
</div>
</div>
<?php
}
开发者ID:mkessel007,项目名称:resume-builder,代码行数:48,代码来源:Carbon_Field.php
示例13: wp_nonce_field
<form action="press-this.php?action=post" method="post">
<?php wp_nonce_field('press-this') ?>
<input type="hidden" name="post_type" id="post_type" value="text"/>
<div id="posting">
<h2 id="title"><label for="post_title"><?php _e('Title') ?></label></h2>
<div class="titlewrap">
<input name="post_title" id="post_title" class="text" value="<?php echo attribute_escape($title);?>"/>
</div>
<div id="extra_fields" style="display: none"></div>
<div class="editor_area">
<h2 id="content_type"><label for="content"><?php _e('Post') ?></label></h2>
<div class="editor-container">
<textarea name="content" id="content" style="width:100%;" class="mceEditor" rows="15"><?php if ($selection) { echo wp_richedit_pre($selection); } ?><a href="<?php echo $url ?>"><?php echo $title; ?></a>.</textarea>
</div>
</div>
</div>
<div id="categories">
<div class="submitbox" id="submitpost">
<div id="previewview"></div>
<div class="inside">
<h2><?php _e('Categories') ?></h2>
<div id="categories-all">
<ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
<?php wp_category_checklist() ?>
</ul>
</div>
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:29,代码来源:press-this.php
示例14: form
//.........这里部分代码省略.........
</p> <?php
}
if (isset($spot_post)) {
?>
<div class="code-toggle hide-if-no-js">
<a href="#" class="button visual" data-id="<?php
echo $this->get_field_id('content');
?>
" ><?php
_e('Visual', SPOTS_DOM);
?>
</a>
<a href="#" class="button text" data-id="<?php
echo $this->get_field_id('content');
?>
"><?php
_e('Text', SPOTS_DOM);
?>
</a>
</div>
<div class="editorcontainer wp-editor-wrap">
<textarea cols="40" rows="10" class="widefat mceme" id="<?php
echo $this->get_field_id('content');
?>
" name="<?php
echo $this->get_field_name('content');
?>
">
<?php
if (version_compare($wp_version, '4.3', '>=')) {
echo format_for_editor($spot_post->post_content);
} else {
echo wp_richedit_pre($spot_post->post_content);
}
?>
</textarea>
</div>
<?php
if (version_compare($wp_version, '3.5', '<')) {
?>
<div class="spot-featured-image">
<?php
// show featured image if set
if (current_theme_supports('post-thumbnails')) {
echo $this->_wp_post_thumbnail_html(null, $spot_post->ID);
}
?>
</div>
<?php
}
}
$templates = icit_spots::$instance_spots->get_templates();
if ($templates) {
?>
<p>
<label for="<?php
echo $this->get_field_id('template');
?>
"><?php
_e('Template', SPOTS_DOM);
?>
</label>
开发者ID:sevir,项目名称:toffy-lite,代码行数:67,代码来源:icit-spots.php
示例15: create_field
function create_field($field)
{
global $wp_version;
// vars
$defaults = array('toolbar' => 'full', 'media_upload' => 'yes');
$field = array_merge($defaults, $field);
$id = 'wysiwyg-' . $field['id'];
?>
<div id="wp-<?php
echo $id;
?>
-wrap" class="acf_wysiwyg wp-editor-wrap" data-toolbar="<?php
echo $field['toolbar'];
?>
" data-upload="<?php
echo $field['media_upload'];
?>
">
<?php
if ($field['media_upload'] == 'yes') {
?>
<?php
if (version_compare($wp_version, '3.3', '<')) {
?>
<div id="editor-toolbar">
<div id="media-buttons" class="hide-if-no-js">
<?php
do_action('media_buttons');
?>
</div>
</div>
<?php
} else {
?>
<div id="wp-<?php
echo $id;
?>
-editor-tools" class="wp-editor-tools">
<div id="wp-<?php
echo $id;
?>
-media-buttons" class="hide-if-no-js wp-media-buttons">
<?php
do_action('media_buttons');
?>
</div>
</div>
<?php
}
?>
<?php
}
?>
<div id="wp-<?php
echo $id;
?>
-editor-container" class="wp-editor-container">
<textarea id="<?php
echo $id;
?>
" class="wp-editor-area" name="<?php
echo $field['name'];
?>
" ><?php
echo wp_richedit_pre($field['value']);
?>
</textarea>
</div>
</div>
<?php
}
开发者ID:alek0805,项目名称:8020consulting,代码行数:72,代码来源:wysiwyg.php
示例16: create_field
function create_field($field)
{
// vars
$field['toolbar'] = isset($field['toolbar']) ? $field['toolbar'] : 'full';
$field['media_upload'] = isset($field['media_upload']) ? $field['media_upload'] : 'yes';
$id = 'wysiwyg_' . uniqid();
?>
<div class="acf_wysiwyg" data-toolbar="<?php
echo $field['toolbar'];
?>
">
<?php
if ($field['media_upload'] == 'yes') {
?>
<div id="editor-toolbar" class="hide-if-no-js">
<div id="media-buttons" class="hide-if-no-js">
Upload/Insert
<a title="Add an Image" class="thickbox" id="add_image" href="media-upload.php?post_id=1802&type=image&TB_iframe=1&width=640&height=314">
<img onclick="return false;" alt="Add an Image" src="<?php
echo $this->parent->wpadminurl;
?>
/images/media-button-image.gif?ver=20100531">
</a>
<a title="Add Video" class="thickbox" id="add_video" href="media-upload.php?post_id=1802&type=video&TB_iframe=1&width=640&height=314">
<img onclick="return false;" alt="Add Video" src="<?php
echo $this->parent->wpadminurl;
?>
/images/media-button-video.gif?ver=20100531">
</a>
<a title="Add Audio" class="thickbox" id="add_audio" href="media-upload.php?post_id=1802&type=audio&TB_iframe=1&width=640&height=314">
<img onclick="return false;" alt="Add Audio" src="<?php
echo $this->parent->wpadminurl;
?>
/images/media-button-music.gif?ver=20100531">
</a>
<a title="Add Media" class="thickbox" id="add_media" href="media-upload.php?post_id=1802&TB_iframe=1&width=640&height=314">
<img onclick="return false;" alt="Add Media" src="<?php
echo $this->parent->wpadminurl;
?>
/images/media-button-other.gif?ver=20100531">
</a>
</div>
</div>
<?php
}
?>
<div id="editorcontainer">
<textarea id="<?php
echo $field['name'];
?>
" name="<?php
echo $field['name'];
?>
" ><?php
echo wp_richedit_pre($field['value']);
?>
</textarea>
</div>
</div>
<?php
}
开发者ID:netconstructor,项目名称:advanced-custom-fields,代码行数:61,代码来源:wysiwyg.php
示例17: save_update_form
/**
* Save the form
*
* @access public
* @since 2.8.1
* @return void
*/
public function save_update_form()
{
global $wpdb;
if (!isset($_REQUEST['action']) || !isset($_GET['page'])) {
return;
}
if ('visual-form-builder' !== $_GET['page']) {
return;
}
if ('update_form' !== $_REQUEST['action']) {
return;
}
check_admin_referer('vfb_update_form');
$form_id = absint($_REQUEST['form_id']);
$form_key = sanitize_title($_REQUEST['form_title'], $form_id);
$form_title = $_REQUEST['form_title'];
$form_subject = $_REQUEST['form_email_subject'];
$form_to = serialize(array_map('sanitize_email', $_REQUEST['form_email_to']));
$form_from = sanitize_email($_REQUEST['form_email_from']);
$form_from_name = $_REQUEST['form_email_from_name'];
$form_from_override = isset($_REQUEST['form_email_from_override']) ? $_REQUEST['form_email_from_override'] : '';
$form_from_name_override = isset($_REQUEST['form_email_from_name_override']) ? $_REQUEST['form_email_from_name_override'] : '';
$form_success_type = $_REQUEST['form_success_type'];
$form_notification_setting = isset($_REQUEST['form_notification_setting']) ? $_REQUEST['form_notification_setting'] : '';
$form_notification_email_name = isset($_REQUEST['form_notification_email_name']) ? $_REQUEST['form_notification_email_name'] : '';
$form_notification_email_from = isset($_REQUEST['form_notification_email_from']) ? sanitize_email($_REQUEST['form_notification_email_from']) : '';
$form_notification_email = isset($_REQUEST['form_notification_email']) ? $_REQUEST['form_notification_email'] : '';
$form_notification_subject = isset($_REQUEST['form_notification_subject']) ? $_REQUEST['form_notification_subject'] : '';
$form_notification_message = isset($_REQUEST['form_notification_message']) ? wp_richedit_pre($_REQUEST['form_notification_message']) : '';
$form_notification_entry = isset($_REQUEST['form_notification_entry']) ? $_REQUEST['form_notification_entry'] : '';
$form_label_alignment = $_REQUEST['form_label_alignment'];
// Add confirmation based on which type was selected
switch ($form_success_type) {
case 'text':
$form_success_message = wp_richedit_pre($_REQUEST['form_success_message_text']);
break;
case 'page':
$form_success_message = $_REQUEST['form_success_message_page'];
break;
case 'redirect':
$form_success_message = $_REQUEST['form_success_message_redirect'];
break;
}
$newdata = array('form_key' => $form_key, 'form_title' => $form_title, 'form_email_subject' => $form_subject, 'form_email_to' => $form_to, 'form_email_from' => $form_from, 'form_email_from_name' => $form_from_name, 'form_email_from_override' => $form_from_override, 'form_email_from_name_override' => $form_from_name_override, 'form_success_type' => $form_success_type, 'form_success_message' => $form_success_message, 'form_notification_setting' => $form_notification_setting, 'form_notification_email_name' => $form_notification_email_name, 'form_notification_email_from' => $form_notification_email_from, 'form_notification_email' => $form_notification_email, 'form_notification_subject' => $form_notification_subject, 'form_notification_message' => $form_notification_message, 'form_notification_entry' => $form_notification_entry, 'form_label_alignment' => $form_label_alignment);
$where = array('form_id' => $form_id);
// Update form details
$wpdb->update($this->form_table_name, $newdata, $where);
$field_ids = array();
// Get max post vars, if available. Otherwise set to 1000
$max_post_vars = ini_get('max_input_vars') ? intval(ini_get('max_input_vars')) : 1000;
// Set a message to be displayed if we've reached a limit
if (count($_POST, COUNT_RECURSIVE) > $max_post_vars) {
$this->post_max_vars = true;
}
foreach ($_REQUEST['field_id'] as $fields) {
$field_ids[] = $fields;
}
// Initialize field sequence
$field_sequence = 0;
// Loop through each field and update
foreach ($field_ids as $id) {
$id = absint($id);
$field_name = isset($_REQUEST['field_name-' . $id]) ? trim($_REQUEST['field_name-' . $id]) : '';
$field_key = sanitize_key(sanitize_title($field_name, $id));
$field_desc = isset($_REQUEST['field_description-' . $id]) ? trim($_REQUEST['field_description-' . $id]) : '';
$field_options = isset($_REQUEST['field_options-' . $id]) ? serialize(array_map('trim', $_REQUEST['field_options-' . $id])) : '';
$field_validation = isset($_REQUEST['field_validation-' . $id]) ? $_REQUEST['field_validation-' . $id] : '';
$field_required = isset($_REQUEST['field_required-' . $id]) ? $_REQUEST['field_required-' . $id] : '';
$field_size = isset($_REQUEST['field_size-' . $id]) ? $_REQUEST['field_size-' . $id] : '';
$field_css = isset($_REQUEST['field_css-' . $id]) ? $_REQUEST['field_css-' . $id] : '';
$field_layout = isset($_REQUEST['field_layout-' . $id]) ? $_REQUEST['field_layout-' . $id] : '';
$field_default = isset($_REQUEST['field_default-' . $id]) ? trim($_REQUEST['field_default-' . $id]) : '';
$field_data = array('field_key' => $field_key, 'field_name' => $field_name,
|
请发表评论