对TinyMCE在可湿性粉剂核心中的VAR的解释在哪里?

时间:2015-04-21 作者:Bram Vanroy

我正在为我的用户修改TinyMCE编辑器,我正在使用这个示例in the docs 作为起点。

function my_format_TinyMCE( $in ) {
    $in[\'remove_linebreaks\'] = false;
    $in[\'gecko_spellcheck\'] = false;
    $in[\'keep_styles\'] = true;
    $in[\'accessibility_focus\'] = true;
    $in[\'tabfocus_elements\'] = \'major-publishing-actions\';
    $in[\'media_strict\'] = false;
    $in[\'paste_remove_styles\'] = false;
    $in[\'paste_remove_spans\'] = false;
    $in[\'paste_strip_class_attributes\'] = \'none\';
    $in[\'paste_text_use_dialog\'] = true;
    $in[\'wpeditimage_disable_captions\'] = true;
    $in[\'plugins\'] = \'tabfocus,paste,media,fullscreen,wordpress,wpeditimage,wpgallery,wplink,wpdialogs,wpfullscreen\';
    $in[\'content_css\'] = get_template_directory_uri() . "/editor-style.css";
    $in[\'wpautop\'] = true;
    $in[\'apply_source_formatting\'] = false;
        $in[\'block_formats\'] = "Paragraph=p; Heading 3=h3; Heading 4=h4";
    $in[\'toolbar1\'] = \'bold,italic,strikethrough,bullist,numlist,blockquote,hr,alignleft,aligncenter,alignright,link,unlink,wp_more,spellchecker,wp_fullscreen,wp_adv \';
    $in[\'toolbar2\'] = \'formatselect,underline,alignjustify,forecolor,pastetext,removeformat,charmap,outdent,indent,undo,redo,wp_help \';
    $in[\'toolbar3\'] = \'\';
    $in[\'toolbar4\'] = \'\';
    return $in;
}
其中一些变量是不言自明的(例如,删除换行符)。然而,并非所有都是(例如,wpautop)。我找不到这方面的任何文件。我在寻找所有的解释,不仅仅是wpautop。

1 个回复
SO网友:Rene Korss

其中一些是TinyMCE核心选项。您可以在中查看它们TinyMCE - Configuration.

在文件中/wp-includes/class-wp-editor.php 有一些解释。显然这还不是全部,但这只是一个开始。

/**
 * Parse default arguments for the editor instance.
 *
 * @param string $editor_id ID for the current editor instance.
 * @param array  $settings {
 *     Array of editor arguments.
 *
 *     @type bool       $wpautop           Whether to use wpautop(). Default true.
 *     @type bool       $media_buttons     Whether to show the Add Media/other media buttons.
 *     @type string     $default_editor    When both TinyMCE and Quicktags are used, set which
 *                                         editor is shown on page load. Default empty.
 *     @type bool       $drag_drop_upload  Whether to enable drag & drop on the editor uploading. Default false.
 *                                         Requires the media modal.
 *     @type string     $textarea_name     Give the textarea a unique name here. Square brackets
 *                                         can be used here. Default $editor_id.
 *     @type int        $textarea_rows     Number rows in the editor textarea. Default 20.
 *     @type string|int $tabindex          Tabindex value to use. Default empty.
 *     @type string     $tabfocus_elements The previous and next element ID to move the focus to
 *                                         when pressing the Tab key in TinyMCE. Defualt \':prev,:next\'.
 *     @type string     $editor_css        Intended for extra styles for both Visual and Text editors.
 *                                         Should include `<style>` tags, and can use "scoped". Default empty.
 *     @type string     $editor_class      Extra classes to add to the editor textarea elemen. Default empty.
 *     @type bool       $teeny             Whether to output the minimal editor config. Examples include
 *                                         Press This and the Comment editor. Default false.
 *     @type bool       $dfw               Whether to replace the default fullscreen with "Distraction Free
 *                                         Writing". DFW requires specific DOM elements and css). Default false.
 *     @type bool|array $tinymce           Whether to load TinyMCE. Can be used to pass settings directly to
 *                                         TinyMCE using an array. Default true.
 *     @type bool|array $quicktags         Whether to load Quicktags. Can be used to pass settings directly to
 *                                         Quicktags using an array. Default true.
 * }
 * @return array Parsed arguments array.
 */
你可以找到wpautop 文档打开Codex.

结束

相关推荐

TinyMCE Java脚本URL问题

ed.windowManager.open({ file : url + \'/shortcode_generator_popup.php\', 我想将此文件移到当前文件夹的上方一个文件夹。我想知道我如何重写它,以便指向上面的文件夹。我尝试了:文件:url+\'/shortcode\\u generator\\u弹出窗口。php’但当然它只会变成:/includes/js/shortcode\\u generator\\u弹出窗口。php谢谢你的帮助!