Example #1
0
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 
}
 /**
  * @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]"));
 }
 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));
         }
     }
 }
Example #4
0
 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');
 }
Example #5
0
 /**
  * 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']);
 }
/**
 * 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);
            }
        }
    }
}
Example #7
0
 /**
  * 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')));
     }
 }
    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);
    }
Example #9
0
/**
 * 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');
}
Example #10
0
    /**
     * 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;
    }
Example #11
0
 /**
  * ŠŸŠ¾Š“ŠŗŠ»ŃŽŃ‡ŠµŠ½ŠøŠµ 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);
     }
 }
Example #12
0
 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'));
 }
 /**
  * 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();
 }
Example #14
0
/**
 * 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));
}
 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();
 }
    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 
    }
Example #17
0
 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>';
 }
Example #18
0
 /**
  * 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>' : '';
 }
Example #19
0
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 
}
Example #20
0
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;
}
    /**
     * Render option page type.
     */
    public function render()
    {
        ?>
		<div class="wrap">
			<h2><?php 
        echo esc_html($this->name);
        ?>
</h2>
			<form id="post" method="post" name="post">
				<div id="papi-hidden-editor" class="hide-if-js">
					<?php 
        wp_nonce_field('papi_save_data', 'papi_meta_nonce');
        ?>
					<?php 
        wp_editor('', 'papiHiddenEditor');
        ?>
				</div>
				<div id="poststuff">
					<div id="post-body">
						<?php 
        do_meta_boxes($this->post_type[0], 'normal', null);
        ?>
						<?php 
        submit_button();
        ?>
					</div>
				</div>
			</form>
		</div>
		<?php 
    }
    function form($instance)
    {
        $defaults = array('text' => '');
        $instance = wp_parse_args($instance, $defaults);
        extract($instance);
        ?>
		<p class="description">
			<label for="<?php 
        echo $this->get_field_id('title');
        ?>
">
				Title (optional)
				<?php 
        echo aq_field_input('title', $block_id, $title, $size = 'full');
        ?>
			</label>
		</p>
		
		<p class="description">
			<label for="<?php 
        echo $this->get_field_id('text');
        ?>
">
				Content
				<?php 
        $args = array('tinymce' => true, 'quicktags' => true, 'textarea_name' => $this->get_field_name('text'));
        wp_editor(htmlspecialchars_decode($text), $this->get_field_id('text'), $args);
        ?>
			</label>
		</p>
		
		<?php 
    }
Example #23
0
    public function html($meta, $repeatable = null)
    {
        is_array($meta) and $meta = null;
        $name = is_null($repeatable) ? $this->_name : $this->_name . '[' . $repeatable . ']';
        $id = is_null($repeatable) ? $this->_id : $this->_id . '_' . $repeatable;
        $classes = array();
        if (!empty($this->_params['context']) and $this->_params['context'] != 'side') {
            $classes[] = 'form-field';
        }
        $classes = implode(' ', $classes);
        empty($classes) or $classes = ' class="' . $classes . '"';
        echo '<tr' . $classes . '>';
        echo '
			<th>
				<label for="' . $id . '">' . $this->_label . '</label>
			</th>
			<td>
        ';
        if (!empty($this->_params['disabled'])) {
            echo apply_filters('the_content', $meta);
        } else {
            wp_editor($meta, $this->_id);
        }
        if (!empty($this->_description)) {
            echo '<p class="description">' . $this->_description . '</p>';
        }
        echo '</td>';
        echo '</tr>';
    }
    /**
     * Outputs the field.
     *
     * @since 1.1.0
     *
     * @param string $name Name of the field.
     * @param mixed $value Value of the field.
     * @param string $label Field label.
     * @param array $args Field arguments.
     */
    public static function field($name, $value, $label = '', $args = array())
    {
        if ($label) {
            ?>
			<p class="rbm-field-wysiwyg-label">
				<?php 
            echo $label;
            ?>
			</p>
		<?php 
        }
        ?>

		<div class="rbm-field-wysiwyg<?php 
        echo $args['wrapper_class'] !== '' ? ' ' . $args['wrapper_class'] : '';
        echo isset($args['wysiwyg_args']['teeny']) && $args['wysiwyg_args']['teeny'] ? ' teeny' : '';
        ?>
"
		     data-id="<?php 
        echo $args['wysiwyg_id'];
        ?>
">

			<?php 
        wp_editor($value, "_rbm_{$args['wysiwyg_id']}", $args['wysiwyg_args']);
        ?>

			<?php 
        echo $args['description'] ? "<br/><span class=\"description\">{$args['description']}</span>" : '';
        ?>
		</div>
		<?php 
    }
    function output_shortcode_generator()
    {
        ?>
		
		<p>Using the buttons below, select your desired method and options for displaying Testimonials.</p>
		<p>Instructions:</p>
		<ol>
			<li>Click the Testimonials button, below,</li>
			<li>Pick from the available display methods listed, such as Grid of Testimonials,</li>
			<li>Set the options for your desired method of display,</li>
			<li>Click "Insert Now" to generate the shortcode.</li>
			<li>The generated shortcode will appear in the textarea below - simply copy and paste this into the Page or Post where you would like Testimonials to appear!</li>
		</ol>
		
		<div id="easy-t-shortcode-generator">
		
		<?php 
        $content = "";
        //initial content displayed in the editor_id
        $editor_id = "easy_t_shortcode_generator";
        //HTML id attribute for the textarea NOTE hyphens will break it
        $settings = array('quicktags' => false);
        wp_editor($content, $editor_id, $settings);
        ?>
		</div>
		<?php 
    }
Example #26
0
function patterns_meta_box($post)
{
    wp_nonce_field(plugin_basename(__FILE__), 'patterns_noncename');
    $html = get_post_meta($post->ID, 'html', true);
    $css = get_post_meta($post->ID, 'css', true);
    $resources = get_post_meta($post->ID, 'resources', true);
    $notes = get_post_meta($post->ID, 'notes', true);
    $height = get_post_meta($post->ID, 'height', true);
    $usepattern = get_post_meta($post->ID, 'usepattern', true);
    echo '<label for="' . $post->post_name . '"><input type="checkbox" name="usepattern" id="usepattern" value="true"' . ($usepattern ? ' checked="true"' : '') . '>Show Pattern Options</input></label><br/>';
    echo '<label class="pattern-label" for="resources">Resources</label>';
    echo '<div class="form-wrap">
  	      <fieldset>';
    $args = array('post_type' => 'resource', 'published' => true, 'meta_key' => 'priority', 'orderby' => 'meta_value_num', 'order' => 'ASC');
    $myposts = get_posts($args);
    foreach ($myposts as $post) {
        setup_postdata($post);
        echo '<label for="' . $post->post_name . '"><input type="checkbox" name="resources[]" id="' . $post->post_name . '" value="' . $post->ID . '"' . ($resources && in_array($post->ID, $resources) ? ' checked="true"' : '') . '>' . $post->post_title . '</input></label>';
    }
    wp_reset_postdata();
    echo '</fieldset>
  	      </div>';
    echo '<label class="pattern-label" for="html">Preview Height (px)</label>';
    echo '<input type="number" id="height" name="height" style="width:120px;float:left;clear:both;" value="' . ($height ? $height : "300") . '"/>';
    echo '<label class="pattern-label" for="html">HTML</label>';
    echo '<textarea id="html" name="html" rows="10" cols="90" style="width:100%">' . $html . '</textarea>';
    echo '<label class="pattern-label" for="css">CSS</label>';
    echo '<textarea id="css" name="css" rows="10" cols="90" style="width:100%">' . $css . '</textarea>';
    echo '<div class="form-wrap"><label class="pattern-label">Notes</label>	';
    wp_editor($notes, 'notes');
    echo "</div>";
}
Example #27
0
    public function htmlOutput()
    {
        ob_start();
        ?>
		<div style="display: none;">
			<input type="hidden" id="post_ID" name="post_ID" value="<?php 
        echo $this->post->ID;
        ?>
">
			<textarea cols="30" rows="10" id="wpv_content" name="wpv_content" data-bind="textInput: postContentAccepted"></textarea>
			<?php 
        wp_editor($this->post->post_content, 'content', array('media_buttons' => true));
        ?>
		</div>

		<div id="wpb_visual_composer" style="padding-bottom: 5px; background: #fff;"><?php 
        $this->editor->renderEditor($this->post);
        ?>
</div>
		<?php 
        $script = "<script>\n\t\t\t\tjQuery( window ).load( function( ) {\n\t\t\t\t\t/* no fullscreen, no vc save button */\n\t\t\t\t\tjQuery( '#vc_navbar .vc_save-backend, #vc_fullscreen-button' ).remove();\n\n\t\t\t\t\t/* show vc editor */\n\t\t\t\t\tvc.app.show();\n\t\t\t\t\tvc.app.status = 'shown';\n\t\t\t\t\t\n\t\t\t\t\tvar viewsBasicTextarea \t\t = jQuery( '#wpv_content' );\n\t\t\t\t\tvar wordpressDefaultTextarea = jQuery( '#content' );\n\t\t\t\t\t\n\t\t\t\t\t/* Visual Composer fires the 'sync' event everytime something is changed */\n\t\t\t\t\t/* we use this to enable button 'Save all sections at once' if content has changed */\n\t\t\t\t\tvc.shortcodes.on( 'sync', function() {\n\t\t\t\t\t\tif( wordpressDefaultTextarea.val() != viewsBasicTextarea.val() ) {\n\t\t\t\t\t\t\tviewsBasicTextarea.val( wordpressDefaultTextarea.val() );\n\n\t\t\t\t\t\t\tWPViews.ct_edit_screen.vm.postContentAccepted = function(){ return wordpressDefaultTextarea.val() };\n\t\t\t\t\t\t\tWPViews.ct_edit_screen.vm.propertyChangeByComparator( 'postContent', _.isEqual );\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t} );</script>";
        echo preg_replace('/\\v(?:[\\v\\h]+)/', '', $script);
        $output = ob_get_contents();
        ob_end_clean();
        return $output;
    }
Example #28
0
function optimizer_customizer_editor()
{
    ?>

		<div id="wp-editor-widget-container" style="display: none;">
			<a class="close" href="javascript:WPEditorWidget.hideEditor();" title="<?php 
    esc_attr_e('Close', 'optimizer');
    ?>
"><span class="icon"></span></a>
			<div class="editor">
				<?php 
    $settings = array('textarea_rows' => 55, 'editor_height' => 260);
    wp_editor('', 'wpeditorwidget', $settings);
    ?>

				<p><a href="javascript:WPEditorWidget.updateWidgetAndCloseEditor(true);" class="button button-primary"><?php 
    _e('Save and close', 'optimizer');
    ?>
</a></p>
			</div>
		</div>
		<div id="wp-editor-widget-backdrop" style="display: none;"></div>

		<?php 
}
Example #29
0
 public function display($args)
 {
     extract(wp_parse_args($args, array('content' => '', 'id' => 'dwqa-custom-content-editor', 'textarea_name' => 'custom-content', 'rows' => 5, 'wpautop' => false, 'media_buttons' => false)));
     $dwqa_tinymce_css = apply_filters('dwqa_editor_style', DWQA_URI . 'assets/css/tinymce.css');
     $toolbar1 = apply_filters('dwqa_tinymce_toolbar1', 'bold,italic,underline,|,' . 'bullist,numlist,blockquote,|,' . 'link,unlink,|,' . 'image,code,|,' . 'spellchecker,fullscreen,dwqaCodeEmbed,|,');
     wp_editor($content, $id, array('wpautop' => $wpautop, 'media_buttons' => $media_buttons, 'textarea_name' => $textarea_name, 'textarea_rows' => $rows, 'tinymce' => array('toolbar1' => $toolbar1, 'toolbar2' => '', 'content_css' => $dwqa_tinymce_css), 'quicktags' => false));
 }
 protected function textarea(WP_Form_Element $element)
 {
     $attributes = $element->get_all_attributes();
     $content = '';
     if (isset($attributes['value'])) {
         $content = $attributes['value'];
         unset($attributes['value']);
     }
     $settings = $this->settings;
     if (empty($settings['textarea_name']) && !empty($attributes['name'])) {
         $settings['textarea_name'] = $attributes['name'];
     }
     if (empty($settings['textarea_rows']) && !empty($attributes['rows'])) {
         $settings['textarea_rows'] = $attributes['rows'];
     }
     $classes = $element->get_classes();
     if (empty($settings['editor_class']) && !empty($classes)) {
         $settings['editor_class'] = implode(' ', $classes);
     }
     $id = $element->get_id();
     if (empty($id) && !empty($attributes['name'])) {
         $id = $attributes['name'];
     }
     ob_start();
     wp_editor($content, $id, $settings);
     return ob_get_clean();
 }