本文整理汇总了PHP中wp_editor函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_editor函数的具体用法?PHP wp_editor怎么用?PHP wp_editor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_editor函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: ac_user_bio_visual_editor
function ac_user_bio_visual_editor($user)
{
// Contributor level user or higher required
if (!current_user_can('edit_posts')) {
return;
}
?>
<table class="form-table">
<tr>
<th><label for="description"><?php
_e('Biographical Info', 'alleycat');
?>
</label></th>
<td>
<?php
$description = get_user_meta($user->ID, 'description', true);
wp_editor($description, 'description');
?>
<p class="description"><?php
_e('Share a little biographical information to fill out your profile. This may be shown publicly.', 'alleycat');
?>
</p>
</td>
</tr>
</table>
<?php
}
开发者ID:Jhorton4,项目名称:Bohldfeys_Portfolio,代码行数:27,代码来源:admin.php
示例2: message_editor
/**
* @param $default_message
*/
function message_editor($default_message)
{
$settings = LP()->settings;
$content = stripslashes($settings->get($this->section['id'] . '.message', $default_message));
$editor_id = 'email_message';
wp_editor(stripslashes($content), $editor_id, array('textarea_rows' => 10, 'wpautop' => false, 'textarea_name' => "lpr_settings[{$this->id}][message]"));
}
开发者ID:thonysmith,项目名称:LearnPress,代码行数:10,代码来源:class-lp-settings-emails.php
示例3: showFields
public static function showFields($mb)
{
$adminTemplatesFolderLocation = dirname(__FILE__) . '/admin_views/';
Mustache_Autoloader::register();
$template = new Mustache_Engine(array('loader' => new Mustache_Loader_FilesystemLoader($adminTemplatesFolderLocation), 'partials_loader' => new Mustache_Loader_FilesystemLoader($adminTemplatesFolderLocation)));
$fields = $mb->fields;
foreach ($fields as $field) {
if (empty($field['name']) || empty($field['fieldType']) || empty($field['labelTitle'])) {
continue;
}
$mb->the_field($field['name']);
if ($field['fieldType'] == 'textarea') {
wp_editor(html_entity_decode($mb->get_the_value()), $mb->get_the_name(), array('wpautop' => true, 'media_buttons' => false, 'textarea_rows' => get_option('default_post_edit_rows', 10), 'tabindex' => '', 'editor_css' => '', 'editor_class' => '', 'teeny' => true, 'dfw' => false, 'tinymce' => false, 'quicktags' => true));
} else {
switch ($field['fieldType']) {
case 'imageUploader':
$fieldHtml = self::getImageUploaderHtml($mb, $template);
break;
default:
$fieldHtml = $template->render('text_field', array('theValue' => $mb->get_the_value(), 'theName' => $mb->get_the_name()));
}
echo $template->render('field_container', array('labelText' => $field['labelTitle'], 'fieldHTML' => $fieldHtml));
}
}
}
开发者ID:zakirsajib,项目名称:Chester-WordPress-MVC-Theme-Framework,代码行数:25,代码来源:wp_alchemy_helpers.php
示例4: render
public function render()
{
require $this->templateHandler->getView('field/wrapper-start');
$args = array('textarea_name' => $this->getConfigData('name'), 'teeny' => true);
wp_editor($this->getFieldValue(), $this->getConfigData('name'), $args);
require $this->templateHandler->getView('field/wrapper-end');
}
开发者ID:dwalkr,项目名称:wp-admin-utility,代码行数:7,代码来源:Editor.php
示例5: render
/**
* Field Render Function.
*
* Takes the vars and outputs the HTML for the field in the settings
*
* @since 1.0.0
* @access public
* @return void
*/
public function render()
{
// Setup up default editor_options
$defaults = array('textarea_name' => $this->args['opt_name'] . '[' . $this->field['id'] . ']', 'editor_class' => $this->field['class'], 'textarea_rows' => 10, 'teeny' => true);
$this->field['editor_options'] = wp_parse_args($this->field['editor_options'], $defaults);
wp_editor($this->value, $this->field['id'], $this->field['editor_options']);
}
开发者ID:nhatnam1102,项目名称:wp-content,代码行数:16,代码来源:field_editor.php
示例6: wpcf_admin_post_meta_box
/**
* Renders meta box content.
*
* @param type $post
* @param type $group
*/
function wpcf_admin_post_meta_box($post, $group)
{
if (!empty($group['args']['fields'])) {
// Display description
if (!empty($group['args']['description'])) {
echo '<div class="wpcf-meta-box-description">' . wpautop(wpcf_translate('group ' . $group['args']['id'] . ' description', $group['args']['description'])) . '</div>';
}
foreach ($group['args']['fields'] as $field_slug => $field) {
// Render form elements
if (wpcf_compare_wp_version() && $field['#type'] == 'wysiwyg') {
// Especially for WYSIWYG
unset($field['#before'], $field['#after']);
echo '<div class="wpcf-wysiwyg">';
echo '<div id="wpcf-textarea-textarea-wrapper" class="form-item form-item-textarea wpcf-form-item wpcf-form-item-textarea">
<label class="wpcf-form-label wpcf-form-textarea-label">' . $field['#title'] . '</label>';
echo '<div class="description wpcf-form-description wpcf-form-description-textarea description-textarea">
' . wpautop($field['#description']) . '</div>';
wp_editor($field['#value'], $field['#id'], $field['#editor_settings']);
$field['slug'] = str_replace(WPCF_META_PREFIX . 'wysiwyg-', '', $field_slug);
$field['type'] = 'wysiwyg';
echo '</div></div><br /><br />';
} else {
if ($field['#type'] == 'wysiwyg') {
$field['#type'] = 'textarea';
}
echo wpcf_form_simple(array($field['#id'] => $field));
}
do_action('wpcf_fields_' . $field_slug . '_meta_box_form', $field);
if (isset($field['wpcf-type'])) {
// May be ignored
do_action('wpcf_fields_' . $field['wpcf-type'] . '_meta_box_form', $field);
}
}
}
}
开发者ID:rdbartlett,项目名称:kellyspencer.co.nz,代码行数:41,代码来源:fields-post.php
示例7: admin_enqueue_scripts
/**
* Queue assets for taxonomy screens.
*
* @since 1.5.0
*/
public function admin_enqueue_scripts()
{
$pagenow = $GLOBALS['pagenow'];
if (!(self::is_term_edit($pagenow) || self::is_term_overview($pagenow))) {
return;
}
$asset_manager = new WPSEO_Admin_Asset_Manager();
$asset_manager->enqueue_style('scoring');
$tag_id = filter_input(INPUT_GET, 'tag_ID');
if (self::is_term_edit($pagenow) && !empty($tag_id)) {
wp_enqueue_media();
// Enqueue files needed for upload functionality.
$asset_manager->enqueue_style('metabox-css');
$asset_manager->enqueue_style('snippet');
$asset_manager->enqueue_style('scoring');
wp_editor('', 'description');
$asset_manager->enqueue_script('metabox');
$asset_manager->enqueue_script('term-scraper');
wp_localize_script(WPSEO_Admin_Asset_Manager::PREFIX . 'term-scraper', 'wpseoTermScraperL10n', $this->localize_term_scraper_script());
wp_localize_script(WPSEO_Admin_Asset_Manager::PREFIX . 'replacevar-plugin', 'wpseoReplaceVarsL10n', $this->localize_replace_vars_script());
wp_localize_script(WPSEO_Admin_Asset_Manager::PREFIX . 'metabox', 'wpseoSelect2Locale', substr(get_locale(), 0, 2));
$asset_manager->enqueue_script('admin-media');
wp_localize_script(WPSEO_Admin_Asset_Manager::PREFIX . 'admin-media', 'wpseoMediaL10n', array('choose_image' => __('Use Image', 'wordpress-seo')));
}
}
开发者ID:SayenkoDesign,项目名称:ividf,代码行数:30,代码来源:class-taxonomy.php
示例8: render_content
public function render_content($vals = null)
{
do_action(self::$type_slug . '_before_render_content', $this);
if ($vals != null) {
$this->field = (object) $vals;
}
$value = $vals != null ? $this->field->saved : $this->get_value();
$section = isset($this->page->section) && $this->page->section != '' ? 'data-section="' . $this->page->section . '"' : '';
ob_start();
wp_editor(htmlspecialchars_decode(is_string($value) ? $value : ''), $this->field->alias, array('data-section' => isset($this->page->section) ? $this->page->section : ''));
$this->link();
$html = ob_get_contents();
ob_end_clean();
echo $html;
?>
<script type="text/javascript">
jQuery(document).ready(function($){
$('textarea.wp-editor-area').addClass('custom-data-type');
$('textarea.wp-editor-area').attr('data-section', '<?php
echo isset($this->page->section) ? $this->page->section : '';
?>
' );
$('textarea.wp-editor-area').attr('data-type', 'texteditor-type' );
})
</script>
<?php
do_action(self::$type_slug . '_after_render_content', $this);
}
开发者ID:bangtienmanh,项目名称:Runway-Framework,代码行数:28,代码来源:text-editor.php
示例9: wma_movie_details_render
/**
* Renders the meta_box created at wma_add_movies_metaboxes()
*/
function wma_movie_details_render()
{
global $post;
wp_nonce_field('wma_movie_details_save', 'wma_movie_details_nonce');
$poster_url = sanitize_text_field(get_post_meta($post->ID, '_wma_poster_url', true));
$rating = absint(get_post_meta($post->ID, '_wma_rating', true));
$year = absint(get_post_meta($post->ID, '_wma_year', true));
$description = html_entity_decode(get_post_meta($post->ID, '_wma_description', true));
echo '<p><label for="wma_poster_url">';
_e('Poster URL', 'wma_poster_url');
echo '</label></p>';
echo '<p><input type="text" id="wma_poster_url" name="wma_poster_url"' . ' value="' . esc_attr($poster_url) . '" class="widefat" /></p>';
echo '<p><label for="wma_rating">';
_e('Rating', 'wma_rating');
echo '</label></p>';
echo '<p><label for="wma_rating_1">1</label> ' . '<input type="radio" id="wma_rating_1" name="wma_rating"' . ' value="1" ' . ($rating === 1 ? 'checked' : '') . ' /> ';
echo '<label for="wma_rating_2">2</label> ' . '<input type="radio" id="wma_rating_2" name="wma_rating"' . ' value="2" ' . ($rating === 2 ? 'checked' : '') . ' /> ';
echo '<label for="wma_rating_3">3</label> ' . '<input type="radio" id="wma_rating_3" name="wma_rating"' . ' value="3" ' . ($rating === 3 ? 'checked' : '') . ' /> ';
echo '<label for="wma_rating_4">4</label> ' . '<input type="radio" id="wma_rating_4" name="wma_rating"' . ' value="4" ' . ($rating === 4 ? 'checked' : '') . ' /> ';
echo '<label for="wma_rating_5">5</label> ' . '<input type="radio" id="wma_rating_5" name="wma_rating"' . ' value="5" ' . ($rating === 5 ? 'checked' : '') . ' /></p>';
echo '<p><label for="wma_year">';
_e('Year', 'wma_year');
echo '</label></p>';
echo '<p><input type="text" id="wma_year" name="wma_year"' . ' value="' . esc_attr($year) . '" class="widefat" /></p>';
echo '<p><label for="wma_description">';
_e('Short Description', 'wma_description');
echo '</label></p>';
wp_editor($description, 'wma_description');
}
开发者ID:edgareler,项目名称:wp-movies-api,代码行数:32,代码来源:functions.php
示例10: widget_form_callback
/**
* Short-circuit the WP_Widget_Text form so we can inject our editor
*
* @see WP_Widget::form_callback
*
* @param $instance
* @param $widget
*
* @return mixed
*/
function widget_form_callback($instance, $widget)
{
if (is_a($widget, 'WP_Widget_Text') && false !== $instance) {
add_filter('wp_default_editor', function () {
return 'tinymce';
});
// we need $return for the in_widget_form action
$return = null;
ob_start();
$return = $widget->form($instance);
$form = ob_get_clean();
$top = explode('<textarea', $form);
$bottom = explode('/textarea>', $top[1]);
$top = $top[0];
$bottom = $bottom[1];
ob_start();
?>
<input type="hidden" name="<?php
echo $widget->get_field_name('text');
?>
" value=""><?php
wp_editor(stripslashes($instance['text']), $this->make_editor_id($widget), array('editor_class' => 'sweet-widgets-text-editor', 'editor_height' => '320px'));
$editor = ob_get_clean();
echo $top . $editor . $bottom;
do_action_ref_array('in_widget_form', array(&$widget, &$return, $instance));
$instance = false;
}
return $instance;
}
开发者ID:suaing49,项目名称:sweet-widgets,代码行数:39,代码来源:text-editor.php
示例11: textarea
/**
* Подключение CKEditor
* @param string $name - название поле name
*/
public function textarea($name, $text)
{
if (isset($name)) {
$args = array('wpautop' => 0, 'media_buttons' => 1, 'textarea_name' => $name, 'textarea_rows' => 10, 'tabindex' => null, 'editor_css' => '', 'editor_class' => '', 'teeny' => 0, 'dfw' => 0, 'tinymce' => false, 'quicktags' => 1);
wp_editor(isset($text) ? $text : '', $name, $args);
}
}
开发者ID:kiselyou,项目名称:boilers,代码行数:11,代码来源:editor.php
示例12: generate_metabox
function generate_metabox($post, $args)
{
$data = get_post_custom($post->ID);
$this->post_id = $post->ID;
echo '<input type="hidden" name="' . $this->name . '_noncename" id="' . $this->name . '_noncename" value="' . wp_create_nonce($this->name . '_nonce') . '" />';
foreach ($this->fields as $field) {
if ($field['name'] == 'wp_editor') {
wp_editor($post->post_content, 'content');
} else {
$default = array('type' => 'text', 'name' => '', 'label' => '', 'value' => '', 'default' => '', 'description' => '');
$field = $this->extend($default, $field);
if (isset($data[$field['name']])) {
$val = array('value' => $data[$field['name']][0]);
} else {
$val = array('value' => $field['default']);
}
$field = $this->extend($field, $val);
if ($field['type'] == 'wp_editor') {
wp_editor($field['value'], $field['name']);
} else {
$f = $this->generate_field($field);
echo $f;
}
}
}
add_action('admin_footer', array(&$this, 'admin_footer'));
}
开发者ID:srolland,项目名称:dev,代码行数:27,代码来源:qqp_cpt_meta.php
示例13: display_setting
/**
* Display this setting
* @since 2.0
*/
public function display_setting()
{
$this->args['textarea_name'] = $this->get_input_name();
$value = empty($this->value) && !empty($this->default) ? $this->default : $this->value;
wp_editor($value, preg_replace('/[^\\da-z]/i', '', $this->id), $this->args);
$this->display_description();
}
开发者ID:rafamcalvo,项目名称:restaurant-reservations,代码行数:11,代码来源:AdminPageSetting.Editor.class.php
示例14: handsometestimonials_meta_box_callback
/**
* Prints the box content.
*
* @param WP_Post $post The object for the current post/page.
*/
function handsometestimonials_meta_box_callback($post)
{
// Add an nonce field so we can check for it later.
wp_nonce_field('handsometestimonials_meta_box', 'handsometestimonials_meta_box_nonce');
/*
* Use get_post_meta() to retrieve an existing value
* from the database and use the value for the form.
*/
$testimonial_subtitle = get_post_meta($post->ID, '_subtitle_meta_value_key', true);
$testimonial_subtitle_link = get_post_meta($post->ID, '_subtitle_link_meta_value_key', true);
$testimonial_short = get_post_meta($post->ID, '_testimonialshort_meta_value_key', true);
//Subtitle Field
echo '<label for="testimonial_subtitle">';
_e('Testifier\'s Title, Position, or Location: ', 'hndtst_loc');
echo '</label> ';
echo '<input type="text" id="testimonial_subtitle" name="testimonial_subtitle" placeholder="CEO, Acme Corporation" value="' . esc_attr($testimonial_subtitle) . '" size="25" />';
//Subtitle Link Field
echo '<br /><label for="testimonial_subtitle_link">';
_e('Testifier\'s URL: ', 'hndtst_loc');
echo '</label> ';
echo '<input type="text" id="testimonial_subtitle_link" name="testimonial_subtitle_link" placeholder="http://website.com" value="' . esc_attr($testimonial_subtitle_link) . '" size="25" />';
//Short Testimonial Field
echo '<p><label for="testimonial_short">';
_e('<b>Testimonial: </b>', 'hndtst_loc');
echo '</label></p> ';
wp_editor($testimonial_short, 'testimonial_short', $settings = array('textarea_rows' => 5, 'media_buttons' => false));
}
开发者ID:vicpril,项目名称:rep_bidqa,代码行数:32,代码来源:hndtst_post-type.php
示例15: get_output
public function get_output()
{
$args = array('textarea_name' => 'doesnotmatter', 'media_buttons' => false, 'tinymce' => array('readonly' => 1));
ob_start();
wp_editor($this->get_value(), sprintf('meta-output-%s', $this->get_key()), $args);
return ob_get_clean();
}
开发者ID:gopinathshiva,项目名称:wordpress-vip-plugins,代码行数:7,代码来源:class-meta.php
示例16: boiler_plate
function boiler_plate()
{
?>
<div class="wrap">
<h2><?php
_e("Press Release Boilerplate", 'press-news-events');
?>
</h2>
<p><?php
_e("This press release boilerplate is shown at the bottom of all press releases. Updating the boilerplate will update all past and future press releases.", 'press-news-events');
?>
</p>
<form action="<?php
echo $_SERVER['REQUEST_URI'];
?>
" method="post">
<?php
wp_nonce_field(plugin_basename(__FILE__), 'pne_nonce_press_release_boiler_plate');
?>
<?php
wp_editor(get_option('pne_press_release_boilderplate'), 'pnepressreleaseboilderplate');
?>
<input type="submit" class="button-primary" value="<?php
echo esc_attr(__("Save"));
?>
" />
</form>
</div> <!-- .wrap -->
<?php
}
开发者ID:kmhcreative,项目名称:press-news-events-xtended,代码行数:33,代码来源:press-release.php
示例17: inquery_this
function inquery_this($post)
{
$meta_biography = get_post_meta($post->ID, 'bro_tour_inquery', true);
echo '<p>';
wp_editor($meta_biography, 'bro_tour_inquery', array('wpautop' => false, 'media_buttons' => false, 'textarea_name' => 'bro_tour_inquery', 'textarea_rows' => 10, 'teeny' => true));
echo '</p>';
}
开发者ID:saiponethaaung,项目名称:mjs,代码行数:7,代码来源:index.php
示例18: render
/**
* Field Render Function.
*
* Takes the vars and outputs the HTML for the field in the settings
*
* @since Themonic_Options 1.0.0
*/
function render()
{
$class = isset($this->field['class']) ? $this->field['class'] : '';
$settings = array('textarea_name' => $this->args['opt_name'] . '[' . $this->field['id'] . ']', 'editor_class' => $class, 'wpautop' => isset($this->field['autop']) ? $this->field['autop'] : true);
wp_editor($this->value, $this->field['id'], $settings);
echo isset($this->field['desc']) && !empty($this->field['desc']) ? '<br/><span class="description">' . $this->field['desc'] . '</span>' : '';
}
开发者ID:tiankwx,项目名称:docker-wordpress,代码行数:14,代码来源:field_editor.php
示例19: box_recipes_print
function box_recipes_print()
{
global $post;
wp_nonce_field("udp_metabox_nonce", "udp_box_nonce");
$meta = get_post_meta($post->ID, 'ingredient', true);
$metaD = get_post_meta($post->ID, 'directions', true);
?>
<p>
<label for="<?php
echo 'ingredient';
?>
">Ingredientes</label><br>
<?php
wp_editor($meta, 'ingredient');
?>
</p>
<p>
<label for="<?php
echo 'directions';
?>
">Preparación</label><br>
<?php
wp_editor($metaD, 'directions');
?>
</p>
<?php
}
开发者ID:juan2ramos,项目名称:casaLuker,代码行数:28,代码来源:recipes.php
示例20: vc_textarea_html_form_field
function vc_textarea_html_form_field($settings, $value)
{
$settings_line = '';
if (function_exists('wp_editor')) {
$default_content = __($value, "js_composer");
$output_value = '';
// WP 3.3+
$is_sh = "";
if (isset($settings['shortcode'])) {
$is_sh = ' is-sh';
// $args['media_buttons'] = false;
// $args['tinymce'] = false;
}
$args = array('editor_class' => 'wpb_vc_param_value wpb-textarea visual_composer_tinymce ' . $settings['param_name'] . ' ' . $settings['type'] . ' ' . $is_sh, 'media_buttons' => true, 'wpautop' => false, 'textarea_rows' => 2);
if (isset($settings['shortcode'])) {
$args['media_buttons'] = false;
}
ob_start();
wp_editor('', 'wpb_tinymce_' . $settings['param_name'], $args);
$output_value = ob_get_contents();
ob_end_clean();
$settings_line .= $output_value . '<input type="hidden" name="vc_textarea_html_content" class="vc_textarea_html_content" value="' . htmlspecialchars($default_content) . '"/>';
}
// $settings_line = '<textarea name="'.$settings['param_name'].'" class="wpb_vc_param_value wpb-textarea visual_composer_tinymce '.$settings['param_name'].' '.$settings['type'].' '.$settings['param_name'].'_tinymce"' . $dependency . '>'.$settings_value.'</textarea>';
return $settings_line;
}
开发者ID:Beutiste,项目名称:wordpress,代码行数:26,代码来源:textarea_html.php
注:本文中的wp_editor函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论