當前位置: 首頁>>代碼示例>>PHP>>正文


PHP _WP_Editors::editor方法代碼示例

本文整理匯總了PHP中_WP_Editors::editor方法的典型用法代碼示例。如果您正苦於以下問題:PHP _WP_Editors::editor方法的具體用法?PHP _WP_Editors::editor怎麽用?PHP _WP_Editors::editor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在_WP_Editors的用法示例。


在下文中一共展示了_WP_Editors::editor方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: 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

示例2: wp_editor

/**
 * Renders an editor.
 *
 * Using this function is the proper way to output all needed components for both TinyMCE and Quicktags.
 * _WP_Editors should not be used directly. See https://core.trac.wordpress.org/ticket/17144.
 *
 * NOTE: Once initialized the TinyMCE editor cannot be safely moved in the DOM. For that reason
 * running wp_editor() inside of a metabox is not a good idea unless only Quicktags is used.
 * On the post edit screen several actions can be used to include additional editors
 * containing TinyMCE: 'edit_page_form', 'edit_form_advanced' and 'dbx_post_sidebar'.
 * See https://core.trac.wordpress.org/ticket/19173 for more information.
 *
 * @see wp-includes/class-wp-editor.php
 * @since 3.3.0
 *
 * @param string $content   Initial content for the editor.
 * @param string $editor_id HTML ID attribute value for the textarea and TinyMCE. Can only be /[a-z]+/.
 * @param array  $settings  See _WP_Editors::editor().
 */
function wp_editor($content, $editor_id, $settings = array())
{
    if (!class_exists('_WP_Editors')) {
        require ABSPATH . WPINC . '/class-wp-editor.php';
    }
    _WP_Editors::editor($content, $editor_id, $settings);
}
開發者ID:jenoya,項目名稱:final,代碼行數:26,代碼來源:general-template.php

示例3: wp_editor

/**
 * Renders an editor.
 *
 * Using this function is the proper way to output all needed components for both TinyMCE and Quicktags.
 * _WP_Editors should not be used directly. See https://core.trac.wordpress.org/ticket/17144.
 *
 * NOTE: Once initialized the TinyMCE editor cannot be safely moved in the DOM. For that reason
 * running wp_editor() inside of a meta box is not a good idea unless only Quicktags is used.
 * On the post edit screen several actions can be used to include additional editors
 * containing TinyMCE: 'edit_page_form', 'edit_form_advanced' and 'dbx_post_sidebar'.
 * See https://core.trac.wordpress.org/ticket/19173 for more information.
 *
 * @see _WP_Editors::editor()
 * @since 3.3.0
 *
 * @param string $content   Initial content for the editor.
 * @param string $editor_id HTML ID attribute value for the textarea and TinyMCE. Can only be /[a-z]+/.
 * @param array  $settings  See _WP_Editors::editor().
 */
function wp_editor($content, $editor_id, $settings = array())
{
    _WP_Editors::editor($content, $editor_id, $settings);
}
開發者ID:inpsyde,項目名稱:wordpress-dev,代碼行數:23,代碼來源:general-template.php


注:本文中的_WP_Editors::editor方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。