WordPress.org

Make WordPress Core

Ticket #17144: 17144-the_editor.patch

File 17144-the_editor.patch, 5.0 KB (added by azaozz, 3 years ago)
  • wp-admin/edit-form-advanced.php

     
    266266<?php if ( post_type_supports($post_type, 'editor') ) { ?> 
    267267<div id="postdivrich" class="postarea"> 
    268268 
    269 <?php wp_editor($post->post_content, 'content'); ?> 
     269<?php the_editor($post->post_content, 'content'); ?> 
    270270 
    271271<table id="post-status-info" cellspacing="0"><tbody><tr> 
    272272        <td id="wp-word-count"><?php printf( __( 'Word count: %s' ), '<span class="word-count">0</span>' ); ?></td> 
  • wp-admin/edit-form-comment.php

     
    121121 
    122122<div id="postdiv" class="postarea"> 
    123123<?php 
    124         $quicktags_settings = array( 'quicktags_buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,spell,close' ); 
    125         wp_editor( $comment->comment_content, 'content', array( 'media_buttons' => false, 'tinymce' => false, 'quicktags' => $quicktags_settings ) ); 
     124        $quicktags_settings = array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,spell,close' ); 
     125        the_editor( $comment->comment_content, 'content', array( 'media_buttons' => false, 'tinymce' => false, 'quicktags' => $quicktags_settings ) ); 
    126126        wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?> 
    127127</div> 
    128128 
  • wp-admin/includes/deprecated.php

     
    1515/** 
    1616 * @since 2.1 
    1717 * @deprecated 2.1 
    18  * @deprecated Use wp_editor(). 
    19  * @see wp_editor() 
     18 * @deprecated Use the_editor(). 
     19 * @see the_editor() 
    2020 */ 
    2121function tinymce_include() { 
    22         _deprecated_function( __FUNCTION__, '2.1', 'wp_editor()' ); 
     22        _deprecated_function( __FUNCTION__, '2.1', 'the_editor()' ); 
    2323 
    24         wp_editor('', 'content'); 
     24        the_editor(''); 
    2525} 
    2626 
    2727/** 
     
    705705/** 
    706706 * @since 2.7 
    707707 * @deprecated 3.3 
    708  * @deprecated Use wp_editor(). 
    709  * @see wp_editor() 
     708 * @deprecated Use the_editor(). 
     709 * @see the_editor() 
    710710 */ 
    711711function wp_tiny_mce() { 
    712         _deprecated_function( __FUNCTION__, '3.3', 'wp_editor()' ); 
    713          
    714         wp_editor('', 'content'); 
     712        _deprecated_function( __FUNCTION__, '3.3' ); 
    715713} 
    716714 
    717715// see WP_Editor for the next 4 
  • wp-includes/deprecated.php

     
    26212621 * 
    26222622 * @see WP_Editor::wp_default_editor() 
    26232623 * @since 2.5.0 
    2624  * @deprecated 3.5 
     2624 * @deprecated 3.3 
    26252625 * 
    26262626 * @return bool 
    26272627 */ 
     
    26372637        return $wp_editor->wp_default_editor(); 
    26382638} 
    26392639 
    2640 /** 
    2641  * Display editor: TinyMCE, HTML, or both. 
    2642  * 
    2643  * @since 2.1.0 
    2644  * @deprecated 3.3  
    2645  * 
    2646  * @param string $content Textarea content. 
    2647  * @param string $id Optional, default is 'content'. HTML ID attribute value. 
    2648  * @param string $prev_id Optional, not used 
    2649  * @param bool $media_buttons Optional, default is true. Whether to display media buttons. 
    2650  * @param int $tab_index Optional, not used 
    2651  */ 
    2652 function the_editor($content, $id = 'content', $prev_id = 'title', $media_buttons = true, $tab_index = 2, $extended = true) { 
    2653          
    2654         wp_editor( $content, $id, array( 'media_buttons' => $media_buttons ) ); 
    2655         return; 
    2656 } 
    2657  
  • wp-includes/general-template.php

     
    17501750} 
    17511751 
    17521752/** 
    1753  * Loads and initializes WP_Editor class if needed, passes the settings for an instance of the editor 
     1753 * Display editor: Visual, HTML, or both. 
     1754 *    
     1755 * Loads and initializes WP_Editor class, passes the settings for an instance of the editor 
    17541756 * 
    17551757 * @see wp-includes/class-wp-editor.php 
    1756  * @since 3.3 
     1758 * @since 2.1.0 
    17571759 * 
    17581760 * @param string $content Initial content for the editor. 
    1759  * @param string $editor_id HTML ID attribute value for the textarea and TinyMCE. 
    1760  * @param array $settings See WP_Editor::editor(). 
     1761 * @param string $editor_id HTML ID for the textarea, TinyMCE and Quicktags, also used to construct the HTML IDs for all surounding elements. 
     1762 * @param array $settings Settings for both editors (TinyMCE and Quicktags) and for the surrounding HTML, see WP_Editor::editor() for description. 
    17611763 */ 
    1762 function wp_editor( $content, $editor_id, $settings = array() ) { 
     1764function the_editor( $content, $editor_id = 'content', $settings = array() ) { 
    17631765        global $wp_editor; 
    17641766 
     1767        if ( !is_array($settings) ) { 
     1768                $settings = array(); // the old arg $prev_id = 'title' is not used 
     1769                $args = func_get_args(); 
     1770 
     1771                $settings['media_buttons'] = !empty($args[3]) ? $args[3] : true; 
     1772                $settings['tabindex'] = !empty($args[4]) ? $args[4] : 2; 
     1773        } 
     1774 
    17651775        if ( !is_a($wp_editor, 'WP_Editor') ) { 
    17661776                require( ABSPATH . WPINC . '/class-wp-editor.php' ); 
    17671777                $wp_editor = new WP_Editor;