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


PHP _WP_Editors类代码示例

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


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

示例1: js_wp_editor

function js_wp_editor($settings = array())
{
    if (!class_exists('_WP_Editors')) {
        require ABSPATH . WPINC . '/class-wp-editor.php';
    }
    $set = _WP_Editors::parse_settings('apid', $settings);
    if (!current_user_can('upload_files')) {
        $set['media_buttons'] = false;
    }
    if ($set['media_buttons']) {
        wp_enqueue_script('thickbox');
        wp_enqueue_style('thickbox');
        wp_enqueue_script('media-upload');
        $post = get_post();
        if (!$post && !empty($GLOBALS['post_ID'])) {
            $post = $GLOBALS['post_ID'];
        }
        wp_enqueue_media(array('post' => $post));
    }
    _WP_Editors::editor_settings('apid', $set);
    $ap_vars = array('url' => get_home_url(), 'includes_url' => includes_url());
    wp_register_script('ap_wpeditor_init', get_template_directory_uri() . '/functions/js-wp-editor.js', array('jquery'), '1.1', true);
    wp_localize_script('ap_wpeditor_init', 'ap_vars', $ap_vars);
    wp_enqueue_script('ap_wpeditor_init');
}
开发者ID:rsantellan,项目名称:wordpress-ecommerce,代码行数:25,代码来源:js-wp-editor.php

示例2: load_mce_translation

        function load_mce_translation()
        {
            if (!class_exists('_WP_Editors')) {
                require ABSPATH . WPINC . '/class-wp-editor.php';
            }
            ?>
		<script>var tadvTranslation = <?php 
            echo _WP_Editors::wp_mce_translation('', true);
            ?>
;</script>
		<?php 
        }
开发者ID:Connxt,项目名称:deped-kabankalan-wordpress,代码行数:12,代码来源:tinymce-advanced.php

示例3: __loadTinyMce

 protected function __loadTinyMce()
 {
     if (!class_exists('_WP_Editors', false)) {
         require_once ABSPATH . WPINC . '/class-wp-editor.php';
     }
     /*
      * _WP_Editors shouldn't be used directly, but in this case
      * it's the best way to load WordPress RTE stuff and handle
      * RTE editors in Javascript
      */
     $set = \_WP_Editors::parse_settings(null, array('tinymce' => true, 'quicktags' => false));
     \_WP_Editors::editor_settings('woodlets_tiny_mce', $set);
 }
开发者ID:neochic,项目名称:woodlets,代码行数:13,代码来源:RichtextEditor.php

示例4: op_tiny_mce

function op_tiny_mce($content, $editor_id, $settings = array())
{
    static $wysiwygs;
    if (!isset($wysiwygs)) {
        $wysiwygs = function_exists('wp_editor');
    }
    if ($wysiwygs) {
        if (!class_exists('_WP_Editors')) {
            require OP_FUNC . 'tinymce.php';
        }
        if (defined('OP_POST_PAGE')) {
            $settings['disable_init'] = true;
        }
        _WP_Editors::editor($content, $editor_id, $settings);
    } else {
        echo '<textarea name="' . op_get_var($settings, 'textarea_name', $editor_id) . '" id="' . $editor_id . '" cols="40">' . op_attr($content) . '</textarea>';
    }
}
开发者ID:JalpMi,项目名称:v2contact,代码行数:18,代码来源:admin.php

示例5: js_wp_editor

function js_wp_editor($settings = array())
{
    if (!class_exists('_WP_Editors')) {
        require ABSPATH . WPINC . '/class-wp-editor.php';
    }
    $set = _WP_Editors::parse_settings('apid', $settings);
    if (!current_user_can('upload_files')) {
        $set['media_buttons'] = false;
    }
    if ($set['media_buttons']) {
        wp_enqueue_script('thickbox');
        wp_enqueue_style('thickbox');
        wp_enqueue_script('media-upload');
        $post = get_post();
        if (!$post && !empty($GLOBALS['post_ID'])) {
            $post = $GLOBALS['post_ID'];
        }
        wp_enqueue_media(array('post' => $post));
    }
    _WP_Editors::editor_settings('apid', $set);
}
开发者ID:elolli,项目名称:DreamItReelProductions-Website,代码行数:21,代码来源:assets.php

示例6: js_wp_editor

 function js_wp_editor($settings = array())
 {
     if (!class_exists('_WP_Editors')) {
         require ABSPATH . WPINC . '/class-wp-editor.php';
     }
     $set = _WP_Editors::parse_settings('apid', $settings);
     // if ( !current_user_can( 'upload_files' ) )
     // $set['media_buttons'] = false;
     // if ( $set['media_buttons'] ) {
     // 	wp_enqueue_script( 'thickbox' );
     // 	wp_enqueue_style( 'thickbox' );
     // 	wp_enqueue_script('media-upload');
     // 	$post = get_post();
     // 	if ( ! $post && ! empty( $GLOBALS['post_ID'] ) )
     // 		$post = $GLOBALS['post_ID'];
     // 	wp_enqueue_media( array(
     // 		'post' => $post
     // 	) );
     // }
     _WP_Editors::editor_settings('apid', $set);
     $ap_vars = array('url' => get_home_url(), 'includes_url' => includes_url(), 'upload_files' => current_user_can('upload_files'));
     wp_localize_script('jquery', 'ap_vars', $ap_vars);
 }
开发者ID:Justevolve,项目名称:evolve-framework,代码行数:23,代码来源:js_wp_editor.php

示例7: hrm_tinymce

 function hrm_tinymce($element)
 {
     if (!isset($element['content']) || !isset($element['editor_id'])) {
         return;
     }
     if (empty($element['editor_id'])) {
         return;
     }
     ob_start();
     $settings = isset($element['settings']) && is_array($element['settings']) ? $element['settings'] : array();
     $id = isset($element['id']) ? esc_attr($element['id']) : '';
     $desc = isset($element['desc']) ? esc_attr($element['desc']) : '';
     $wrap_class = isset($element['wrap_class']) ? $element['wrap_class'] : '';
     $wrap_tag = isset($element['wrap_tag']) ? $element['wrap_tag'] : 'div';
     $extra = isset($element['extra']) ? $element['extra'] : array();
     $required = isset($extra['data-hrm_required']) && $extra['data-hrm_required'] === true ? '*' : '';
     $label = isset($element['label']) ? esc_attr($element['label']) : '';
     echo $this->multiple_field_inside_this_wrap($element);
     printf('<%1$s class="hrm-form-field %2$s">', $wrap_tag, $wrap_class);
     printf('<%1$s class="hrm-form-field %2$s">', $wrap_tag, $wrap_class);
     printf('<label for="%1s">%2s<em>%3s</em></label>', $id, $label, $required);
     wp_editor($element['content'], $element['editor_id'], $settings);
     printf('<span class="hrm-clear"></span><span class="description">%s</span>', $desc);
     printf('</%s>', $wrap_tag);
     echo $this->multiple_field_inside_this_wrap_close($element);
     _WP_Editors::editor_js();
     return ob_get_clean();
 }
开发者ID:asaquzzaman,项目名称:email-attachment-to-dropbox,代码行数:28,代码来源:settings.php

示例8: link_modal

 function link_modal()
 {
     if (!class_exists('_WP_Editors')) {
         require ABSPATH . WPINC . '/class-wp-editor.php';
     }
     _WP_Editors::wp_link_dialog();
 }
开发者ID:foxpcteam,项目名称:wp-front-end-editor,代码行数:7,代码来源:class-fee.php

示例9: enqueue_wp_editor_scripts

 public function enqueue_wp_editor_scripts()
 {
     $screen = get_current_screen();
     $allowed_screens = $this->allowed_post_types;
     if (in_array($screen->id, $allowed_screens)) {
         if (!class_exists('_WP_Editors')) {
             require ABSPATH . WPINC . '/class-wp-editor.php';
         }
         $set = _WP_Editors::parse_settings('fusionb_id', array());
         if (!current_user_can('upload_files')) {
             $set['media_buttons'] = false;
         }
         if ($set['media_buttons']) {
             wp_enqueue_script('thickbox');
             wp_enqueue_style('thickbox');
             wp_enqueue_script('media-upload');
             $post = get_post();
             if (!$post && !empty($GLOBALS['post_ID'])) {
                 $post = $GLOBALS['post_ID'];
             }
             wp_enqueue_media(array('post' => $post));
         }
         _WP_Editors::editor_settings('fusionb_id', $set);
     }
 }
开发者ID:jolay,项目名称:maga2.0,代码行数:25,代码来源:class-pagebuilder.php

示例10: bbconnect_get_post_to_edit


//.........这里部分代码省略.........
                $post_type = false;
                $post_type = $_POST['data'];
                if (false == $post_type) {
                    echo '';
                    die;
                }
            }
            $post = get_default_post_to_edit($post_type, true);
            $post_author = $_POST['uid'];
            $action = $_POST['actung'];
        }
        // SET THE NONCE
        if ('user' == $type) {
            bbconnect_user_actions_nonce_field();
        } else {
            bbconnect_post_actions_nonce_field();
        }
        $post_fields = array(array('meta' => array('source' => 'wpr', 'meta_key' => 'post_title', 'name' => __('Title', 'bbconnect'), 'help' => '', 'options' => array('field_type' => 'text', 'req' => true, 'public' => false, 'choices' => false))), array('meta' => array('source' => 'wpr', 'meta_key' => 'post_date', 'name' => __('Date', 'bbconnect'), 'help' => '', 'options' => array('field_type' => 'date', 'req' => true, 'public' => false, 'choices' => false))));
        if ('user' == $type) {
            if (!empty($parent_term)) {
                // Editing existing note
                $post_fields[] = array('post_val' => $parent_term->slug, 'meta' => array('source' => 'tax', 'meta_key' => 'bb_note_type_parent', 'name' => __('Type', 'bbconnect'), 'help' => '', 'options' => array('field_type' => 'select', 'req' => true, 'public' => true, 'choices' => array($parent_term->slug => $parent_term->name))));
                $post_fields[] = array('post_val' => $child_term->slug, 'meta' => array('source' => 'tax', 'meta_key' => 'bb_note_type', 'name' => __('', 'bbconnect'), 'help' => '', 'options' => array('field_type' => 'select', 'req' => false, 'public' => true, 'choices' => array($child_term->slug => $child_term->name))));
            } else {
                // New note
                $parent_term = get_term_by('slug', $_POST['data'], 'bb_note_type');
                $terms = get_terms('bb_note_type', array('hide_empty' => false, 'parent' => $parent_term->term_id));
                $choices = array();
                foreach ($terms as $term) {
                    $choices[$term->slug] = $term->name;
                }
                $post_fields[] = array('meta' => array('source' => 'tax', 'meta_key' => 'bb_note_type', 'name' => __('Type', 'bbconnect'), 'help' => '', 'options' => array('field_type' => 'select', 'req' => true, 'public' => false, 'choices' => $choices)));
                $post_fields[] = array('meta' => array('source' => 'tax', 'meta_key' => 'bb_note_type_parent', 'name' => __('', 'bbconnect'), 'help' => '', 'options' => array('field_type' => 'hidden', 'req' => false, 'public' => false, 'choices' => $parent_term->slug)));
            }
        }
        foreach ($post_fields as $field) {
            $meta_key = $field['meta']['meta_key'];
            $field['type'] = 'post';
            $field['action'] = $action;
            $field['id'] = $post->ID;
            $field['swap_name'] = $meta_key;
            if (isset($post->{$meta_key})) {
                $field['post_val'] = $post->{$meta_key};
            }
            echo '<p><ul style="display: block; float: none;">';
            bbconnect_get_field($field);
            echo '</ul></p>';
        }
        if ('bulk-edit' == $action) {
            echo '<ul><li class="meta-item"><span class="bbconnect-label">';
            echo '<a class="rui off" title="' . $cid . 'bulk-edit">Enable Text</a>';
            echo '</span><span class="bbconnect-field">';
        }
        echo '<div style="width: 90%;padding: .3em;margin: .2em 0;">&nbsp;</div>';
        //echo '<p>'. __( 'Title', 'bbconnect' ) .'<br /><input type="text" name="post_title" class="regular-text" value="'.$post->post_title.'" /></p>';
        //echo '<p>'. __( 'Date', 'bbconnect' ) .'<br /><input type="text" class="bbconnect-date" name="post_date" class="regular-text" value="'.$post->post_date.'" /></p>';
        if (preg_match('/Firefox/i', $_SERVER['HTTP_USER_AGENT'])) {
            wp_editor(stripslashes($post->post_content), $cid, array('tinymce' => false, 'textarea_name' => 'post_content', 'teeny' => true, 'quicktags' => true));
        } else {
            wp_editor(stripslashes($post->post_content), $cid, array('tinymce' => true, 'textarea_name' => 'post_content', 'teeny' => false, 'quicktags' => true));
        }
        if ('bulk-edit' == $action) {
            echo '</span></li></ul>';
        }
        // SET THE META
        if ('user' == $type) {
            bbconnect_user_actions_meta_fields(array('post_id' => $post->ID, 'fields' => bbconnect_get_user_actions_meta(), 'action' => $action, 'post_val' => $post_val));
        } else {
            bbconnect_post_actions_meta_fields(array('post_id' => $post->ID, 'fields' => bbconnect_get_post_actions_meta(), 'action' => $action, 'post_val' => $post_val));
        }
        ?>
        <input type="hidden" name="post_ID" value="<?php 
        echo $post->ID;
        ?>
" />
        <input type="hidden" name="post_status" value="publish" />
        <input type="hidden" name="post_author" value="<?php 
        echo $post_author;
        ?>
" />
        <input type="hidden" name="post_type" value="<?php 
        echo $post_type;
        ?>
" />
        <?php 
        $inline_button = apply_filters('bbconnect_inline_do_action_button', array('<input type="submit" class="bbconnect-actions-save button-primary ' . $type . '" name="save" value="' . __('Save', 'bbconnect') . '" />'), $post_type, $type, $action);
        echo '<div class="tright">';
        echo implode(' ', $inline_button);
        echo '</div>';
    } else {
        echo 'error';
    }
    if ('3.9' <= get_bloginfo('version')) {
        _WP_Editors::enqueue_scripts();
        //print_footer_scripts();
        _WP_Editors::editor_js();
        echo '<script src="' . admin_url('js/editor.js') . '" />';
    }
    die;
}
开发者ID:whatthefork,项目名称:bbconnect,代码行数:101,代码来源:bbconnect-user-actions.php

示例11: ajax_get_link_search_results

 /**
  * Returns search results.
  *
  * Results returned in a format expected by the internal link manager.
  * Doesn't have support for paging.
  *
  * Multiple filters provided for either adding results or short-circuiting
  * the flow at various points.
  *
  * @since 1.1.0
  */
 public static function ajax_get_link_search_results()
 {
     global $wpdb;
     check_ajax_referer('internal-linking', '_ajax_linking_nonce');
     if (isset($_POST['search'])) {
         $results = array();
         $s = stripslashes($_POST['search']);
         $args['s'] = $s;
         $args['page'] = !empty($_POST['page']) ? absint($_POST['page']) : 1;
         $args['per_page'] = 20;
         // Default for usage in filters, otherwise, it shouldn't do anything.
         // Check to see if the request is prepended with a modifier (ex: -wikipedia interrobang, -spotify:artist willie nelson).
         if (0 === mb_strpos($s, '-')) {
             preg_match('/-([^\\s]+)\\s?(.*)?/', $s, $matches);
             $s = trim($matches[2]);
             $args['s'] = $s;
             $args['modifier'] = explode(':', trim($matches[1]));
             $results = (array) apply_filters('better_internal_link_search_modifier-' . $args['modifier'][0], array(), $args);
             if (!empty($results)) {
                 echo json_encode($results);
                 wp_die();
             }
         }
         // Allow plugins to intercept the request and add their own results or short-circuit execution.
         $pre_results = (array) apply_filters('pre_better_internal_link_search_results', array(), $args);
         if (!empty($pre_results)) {
             $results = array_merge($results, $pre_results);
         }
         // Short-circuit if this is a paged request. The first request should have returned all results.
         if (isset($_POST['page']) && $_POST['page'] > 1) {
             wp_die(0);
         }
         // Don't continue if the query length is less than three.
         if (strlen($args['s']) < 3) {
             wp_die(0);
         }
         // @see wp_link_ajax();
         require_once ABSPATH . WPINC . '/class-wp-editor.php';
         $posts = _WP_Editors::wp_link_query($args);
         if ($posts) {
             $future_status_object = get_post_status_object('future');
             $private_status_object = get_post_status_object('private');
             foreach ($posts as $key => $post) {
                 if ('future' == get_post_status($post['ID'])) {
                     $posts[$key]['info'] = $future_status_object->label;
                 } elseif ('private' == get_post_status($post['ID'])) {
                     $posts[$key]['info'] .= ' (' . $private_status_object->label . ')';
                 }
             }
             $results = array_merge($results, $posts);
         }
         if ('yes' === Better_Internal_Link_Search_Settings::get_settings('include_term_results')) {
             // Search for matching term archives.
             $search = '%' . self::esc_like($s) . '%';
             $terms = $wpdb->get_results($wpdb->prepare("SELECT t.term_id, t.name, tt.taxonomy\n\t\t\t\t\tFROM {$wpdb->terms} t\n\t\t\t\t\tINNER JOIN {$wpdb->term_taxonomy} tt ON t.term_id=tt.term_id\n\t\t\t\t\tWHERE t.name LIKE %s\n\t\t\t\t\tORDER BY name ASC", $search));
             if ($terms) {
                 foreach ($terms as $term) {
                     $taxonomy = get_taxonomy($term->taxonomy);
                     if (isset($taxonomy->query_var)) {
                         $results[] = array('title' => trim(esc_html(strip_tags($term->name))), 'permalink' => get_term_link((int) $term->term_id, $term->taxonomy), 'info' => $taxonomy->labels->singular_name);
                     }
                 }
             }
         }
         // Allow results to be filtered one last time and attempt to sort them.
         if (!empty($results)) {
             self::$s = $s;
             $results = apply_filters('better_internal_link_search_results', $results, $args);
             if (apply_filters('better_internal_link_search_sort_results', true, $results, $args)) {
                 usort($results, array(__CLASS__, 'sort_results'));
             }
         }
         // Add shortcut results.
         $shortcuts = (array) self::get_shortcuts();
         if (!empty($shortcuts)) {
             if (array_key_exists($s, $shortcuts)) {
                 array_unshift($results, $shortcuts[$s]);
             } elseif ('shortcuts' == $s) {
                 $results = array_merge($shortcuts, $results);
             }
         }
     }
     if (!isset($results) || empty($results)) {
         wp_die(0);
     }
     echo json_encode($results);
     echo "\n";
     wp_die();
 }
开发者ID:lmartins,项目名称:better-internal-link-search,代码行数:100,代码来源:better-internal-link-search.php

示例12: js_wp_editor

function js_wp_editor($settings = array())
{
    if (!class_exists('_WP_Editors')) {
        require ABSPATH . WPINC . '/class-wp-editor.php';
    }
    $set = _WP_Editors::parse_settings('apid', $settings);
    _WP_Editors::editor_settings('apid', $set);
}
开发者ID:unsognoverde,项目名称:website,代码行数:8,代码来源:modules-admin.php

示例13: views_redesign_html


//.........这里部分代码省略.........
     * Query type (content selection) - Priority 10
     * Query options - Priority 20
     * Ordering - Priority 30
     * Limit and offset - Priority 40
     * Filters - Priority 50
     */
    ?>

		<div class="wpv-filter-section">
			<h3 class="wpv-section-title"><?php 
    _e('The Filter section lets you set up pagination and parametric search, which let visitors control the View query', 'wpv-views');
    ?>
</h3>
			<?php 
    wpv_get_view_filter_introduction_data();
    ?>
			<?php 
    do_action('view-editor-section-filter', $view_settings, $view_id, $user_id);
    ?>
		</div>

		<?php 
    /*
     * Pagination TODO review this. https://icanlocalize.basecamphq.com/projects/7393061-toolset/todo_items/161787682/comments - Priority 50
     * Filters Meta HTML/CSS/JS TODO review this. https://icanlocalize.basecamphq.com/projects/7393061-toolset/todo_items/161787682/comments - Priority 80
     */
    ?>

		<div class="wpv-layout-section">
			<h3 class="wpv-section-title"><?php 
    _e('The Loop Output section styles the View output on the page.', 'wpv-views');
    ?>
</h3>
			<?php 
    $data = wpv_get_view_layout_introduction_data();
    wpv_toolset_help_box($data);
    ?>
			<?php 
    do_action('view-editor-section-layout', $view_settings, $view_layout_settings, $view_id, $user_id);
    ?>
			<?php 
    do_action('view-editor-section-extra', $view_settings, $view_id, $user_id);
    ?>
		</div>
		
        <?php 
    $display_help = isset($_GET['in-iframe-for-layout']) && $_GET['in-iframe-for-layout'] == 1 ? false : true;
    if ($display_help === true) {
        ?>
		<div class="wpv-help-section">
		<?php 
        wpv_display_view_howto_help_box();
        ?>
		</div>
        <?php 
    }
    ?>

		<script type="text/javascript">
			jQuery( function( $ ) {
				jQuery('li.current a').attr('href',jQuery('li.current a').attr('href')+'&view_id=<?php 
    echo esc_attr($view_id);
    ?>
');
			});
		</script>
		<?php 
    /*
     * Output (layout) type - TODO review this https://icanlocalize.basecamphq.com/projects/7393061-toolset/todo_items/162512599/comments - Priority 10 - To remove
     * Output fields TODO this has been reviewed and may be used as training - Priority 20 - To remove
     * Layout templates TODO insert here the new Content Templates editor. https://icanlocalize.basecamphq.com/projects/7393061-toolset/todo_items/161787695/comments - Priority 20 - To review
     * Layout Meta HTML/CSS/JS TODO this has been reviewed and needs some changes. https://icanlocalize.basecamphq.com/projects/7393061-toolset/todo_items/161787640/comments - Priority 40
     * Aditional Javascript files TODO move to its own file - Priority 50
     * Extra sections:
     * 1. Complete output (the_content)
     * 2. Module manager TODO needs to be added
     */
    ?>
	</div>
	<?php 
    /**
     * view-editor-section-hidden
     *
     * Show hidden container for dialogs, pointers and messages that need to be taken by ColorBox from an existing HTML element
     *
     * @param $view_settings
     * @param $view_laqyout_settings
     * @param $view_id
     * @param $user_id
     *
     * @note that you can use the .popup-window-container classname to hide the containers added here
     *
     * @since 1.7
     */
    do_action('view-editor-section-hidden', $view_settings, $view_layout_settings, $view_id, $user_id);
    if (!class_exists('_WP_Editors')) {
        require ABSPATH . WPINC . '/class-wp-editor.php';
    }
    _WP_Editors::wp_link_dialog();
}
开发者ID:supahseppe,项目名称:path-of-gaming,代码行数:101,代码来源:wpv-add-edit.php

示例14: wp_editors

    function wp_editors()
    {
        if (function_exists('wp_editor')) {
            $init_str = '';
            ob_start();
            _WP_Editors::editor_js();
            $js = ob_get_contents();
            ob_end_clean();
            $js = explode('tinyMCEPreInit = {', $js);
            if (count($js) > 0) {
                $js[1] = explode('};', $js[1]);
                if (count($js[1]) > 0) {
                    if (preg_match('/mceInit\\s*:(.*?),\\s*qtInit/is', $js[1][0], $matches)) {
                        $init_str = $matches[1];
                        $js[1][0] = preg_replace('/mceInit\\s*:(.*?),\\s*qtInit/is', 'qtInit', $js[1][0]);
                    }
                }
                $js[1] = implode('};', $js[1]);
            }
            if ($init_str != '') {
                echo '
<script type="text/javascript">
var OP_tinyMCE = ' . $init_str . ';
</script>';
            }
            $js = implode('tinyMCEPreInit = {', $js);
            echo $js;
        }
    }
开发者ID:denis-chmel,项目名称:wordpress,代码行数:29,代码来源:live_editor.php

示例15: add_form_item


//.........这里部分代码省略.........
        $id = $this->generate_field_id($id);
        $item_inline_style = $inline_style ? 'style="' . $inline_style . '"' : '';
        $output = '';
        if (is_array($this->options['hidden_items']) && in_array($item_id, $this->options['hidden_items'])) {
            return;
        }
        switch ($type) {
            case 'submit':
                // $output .= '<input ' . $item_inline_style . ' class="' . $class . ' '.$this->options['class']['submit'].'" id="' . $id . '" name="' . $name . '" type="'.$type.'" value="' . esc_html( $value ) . '" >';
                $type .= ' ' . $class;
                $item_inline_style .= ' id=' . $id;
                $output .= get_submit_button($value, $type, $name, false, $item_inline_style);
                break;
            case 'reset':
                $output .= '<input ' . $item_inline_style . ' class="' . $class . ' ' . $this->options['class']['submit'] . '" id="' . $id . '" name="' . $name . '" type="reset" value="' . esc_html($value) . '" >';
                break;
            case 'text':
                $ui_text = new UI_Text(array('id' => $id, 'name' => $name, 'value' => $value, 'placeholder' => $placeholder, 'class' => $class));
                $output .= $ui_text->render();
                break;
            case 'textarea':
                $ui_textarea = new UI_Textarea(array('id' => $id, 'name' => $name, 'value' => $value, 'placeholder' => $placeholder, 'class' => $class));
                $output .= $ui_textarea->render();
                break;
            case 'select':
                $ui_select = new UI_Select(array('id' => $id, 'name' => $name, 'multiple' => $multiple, 'value' => $value, 'options' => $options, 'class' => $class));
                $output .= $ui_select->render();
                break;
            case 'checkbox':
                $ui_checkbox = new UI_Checkbox(array('id' => $id, 'name' => $name, 'value' => $value, 'options' => $options, 'class' => $class));
                $output .= $ui_checkbox->render();
                break;
            case 'radio':
                $ui_radio = new UI_Radio(array('id' => $id, 'name' => $name, 'value' => $value, 'options' => $options, 'class' => $class));
                $output .= $ui_radio->render();
                break;
            case 'switcher':
                $ui_switcher = new UI_Switcher(array('id' => $id, 'name' => $name, 'value' => $value, 'toggle' => $toggle, 'class' => $class));
                $output .= $ui_switcher->render();
                break;
            case 'stepper':
                $ui_stepper = new UI_Stepper(array('id' => $id, 'name' => $name, 'value' => $value, 'max_value' => $max_value, 'min_value' => $min_value, 'step_value' => $step_value, 'class' => $class));
                $output .= $ui_stepper->render();
                break;
            case 'slider':
                $ui_slider = new UI_Slider(array('id' => $id, 'name' => $name, 'value' => $value, 'max_value' => $max_value, 'min_value' => $min_value, 'step_value' => $step_value, 'class' => $class));
                $output .= $ui_slider->render();
                break;
            case 'rangeslider':
                $ui_range_slider = new UI_Range_Slider(array('id' => $id, 'name' => $name, 'value' => $value, 'max_value' => $max_value, 'min_value' => $min_value, 'step_value' => $step_value, 'class' => $class));
                $output .= $ui_range_slider->render();
                break;
            case 'colorpicker':
                $ui_colorpicker = new UI_Colorpicker(array('id' => $id, 'name' => $name, 'value' => $value, 'class' => $class));
                $output .= $ui_colorpicker->render();
                break;
            case 'media':
                $ui_media = new UI_Media(array('id' => $id, 'name' => $name, 'value' => $value, 'multi_upload' => $multi_upload, 'library_type' => $library_type, 'class' => $class));
                $output .= $ui_media->render();
                break;
            case 'background':
                $ui_background = new UI_Background(array('id' => $id, 'name' => $name, 'value' => $value, 'multi_upload' => $multi_upload, 'library_type' => $library_type, 'class' => $class));
                $output .= $ui_background->render();
                break;
            case 'typography':
                $ui_typography = new UI_Typography(array('id' => $id, 'name' => $name, 'value' => $value, 'class' => $class));
                $output .= $ui_typography->render();
                break;
            case 'ace-editor':
                $ui_ace_editor = new UI_Ace_Editor(array('id' => $id, 'name' => $name, 'value' => $value, 'class' => $class));
                $output .= $ui_ace_editor->render();
                break;
            case 'repeater':
                $ui_repeater = new UI_Repeater(array('id' => $id, 'name' => $name, 'value' => $value, 'class' => $class));
                $output .= $ui_repeater->render();
                break;
            case 'static_area_editor':
                $ui_statics = new UI_Static_Area_Editor(array('id' => $id, 'name' => $name, 'value' => $value, 'options' => $options, 'class' => $class));
                $output .= $ui_statics->render();
                break;
            case 'layouteditor':
                $ui_layout_editor = new UI_Layout_Editor(array('id' => $id, 'name' => $name, 'value' => $value, 'class' => $class));
                $output .= $ui_layout_editor->render();
                break;
            case 'editor':
                //$wrap = false;
                ob_start();
                $settings = array('textarea_name' => $name, 'media_buttons' => 1, 'teeny' => 0, 'textarea_rows' => 10, 'tinymce' => array('setup' => 'function(ed) {
								ed.onChange.add(function(ed) {
									tinyMCE.triggerSave();
								});
							}'));
                wp_editor($value, $id, $settings);
                $output .= ob_get_clean();
                _WP_Editors::editor_js();
                _WP_Editors::enqueue_scripts();
                break;
        }
        return $this->wrap_item($output, $id, 'cherry-section cherry-' . $type . ' ' . $this->options['class']['section'], $title, $label, $description, $hint);
    }
开发者ID:roberto-alarcon,项目名称:Neuroglobal,代码行数:101,代码来源:class-cherry-interface-builder.php


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