Make WordPress Core

Changeset 27808


Ignore:
Timestamp:
03/28/2014 05:45:54 AM (11 years ago)
Author:
DrewAPicture
Message:

Convert wp_editor() default arguments documentation to a hash notation in the _WP_Editors::parse_settings() PHPDoc.

See #27566.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-editor.php

    r27766 r27808  
    2828    private function __construct() {}
    2929
    30     public static function parse_settings($editor_id, $settings) {
     30    /**
     31     * Parse _WP_Editors settings.
     32     *
     33     * @param string $editor_id ID for the current editor isntance.
     34     * @param array  $settings {
     35     *     Array of editor arguments.
     36     *
     37     *     @type bool       $wpautop           Whether to use wpautop(). Default true.
     38     *     @type bool       $media_buttons     Whether to show the Add Media/other media buttons.
     39     *     @type string     $default_editor    When both TinyMCE and Quicktags are used, set which
     40     *                                         editor is shown on page load. Default empty.
     41     *     @type string     $textarea_name     Give the textarea a unique name here. Square brackets
     42     *                                         can be used here. Default $editor_id.
     43     *     @type int        $textarea_rows     Number rows in the editor textarea. Default 20.
     44     *     @type string|int $tabindex          Tabindex value to use. Default empty.
     45     *     @type string     $tabfocus_elements The previous and next element ID to move the focus to
     46     *                                         when pressing the Tab key in TinyMCE. Defualt ':prev,:next'.
     47     *     @type string     $editor_css        Intended for extra styles for both Visual and Text editors.
     48     *                                         Should include <style> tags, and can use "scoped". Default empty.
     49     *     @type string     $editor_class      Extra classes to add to the editor textarea elemen. Default empty.
     50     *     @type bool       $teeny             Whether to output the minimal editor config. Examples include
     51     *                                         Press This and the Comment editor. Default false.
     52     *     @type bool       $dfw               Whether to replace the default fullscreen with "Distraction Free
     53     *                                         Writing". DFW requires specific DOM elements and css). Default false.
     54     *     @type bool|array $tinymce           Whether to load TinyMCE. Can be used to pass settings directly to
     55     *                                         TinyMCE using an array. Default true.
     56     *     @type bool|array $quicktags         Whether to load Quicktags. Can be used to pass settings directly to
     57     *                                         Quicktags using an array. Default true.
     58     * }
     59     * @return array Parsed arguments array.
     60     */
     61    public static function parse_settings( $editor_id, $settings ) {
    3162        $set = wp_parse_args( $settings,  array(
    32             'wpautop' => true, // use wpautop?
    33             'media_buttons' => true, // show insert/upload button(s)
    34             'default_editor' => '', // When both TinyMCE and Quicktags are used, set which editor is shown on loading the page
    35             'textarea_name' => $editor_id, // set the textarea name to something different, square brackets [] can be used here
    36             'textarea_rows' => 20,
    37             'tabindex' => '',
    38             'tabfocus_elements' => ':prev,:next', // the previous and next element ID to move the focus to when pressing the Tab key in TinyMCE
    39             'editor_css' => '', // intended for extra styles for both visual and Text editors buttons, needs to include the <style> tags, can use "scoped".
    40             'editor_class' => '', // add extra class(es) to the editor textarea
    41             'teeny' => false, // output the minimal editor config used in Press This
    42             'dfw' => false, // replace the default fullscreen with DFW (needs specific DOM elements and css)
    43             'tinymce' => true, // load TinyMCE, can be used to pass settings directly to TinyMCE using an array()
    44             'quicktags' => true // load Quicktags, can be used to pass settings directly to Quicktags using an array()
     63            'wpautop'           => true,
     64            'media_buttons'     => true,
     65            'default_editor'    => '',
     66            'textarea_name'     => $editor_id,
     67            'textarea_rows'     => 20,
     68            'tabindex'          => '',
     69            'tabfocus_elements' => ':prev,:next',
     70            'editor_css'        => '',
     71            'editor_class'      => '',
     72            'teeny'             => false,
     73            'dfw'               => false,
     74            'tinymce' =>        true,
     75            'quicktags' =>      true
    4576        ) );
    4677
Note: See TracChangeset for help on using the changeset viewer.