Make WordPress Core


Ignore:
Timestamp:
11/22/2011 09:47:01 PM (13 years ago)
Author:
azaozz
Message:

Restore back-compat with wp_tiny_mce(), see #19320

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/deprecated.php

    r19054 r19408  
    2222    _deprecated_function( __FUNCTION__, '2.1', 'wp_editor()' );
    2323
    24     wp_editor('', 'content');
     24    wp_tiny_mce();
    2525}
    2626
     
    709709 * @see wp_editor()
    710710 */
    711 function wp_tiny_mce() {
     711function wp_tiny_mce( $teeny = false, $settings = false ) {
    712712    _deprecated_function( __FUNCTION__, '3.3', 'wp_editor()' );
    713713
    714     wp_editor('', 'content');
     714    global $wp_editor;
     715    static $num = 1;
     716
     717    if ( !is_a($wp_editor, 'WP_Editor') ) {
     718        if ( !class_exists('WP_Editor') )
     719            require_once( ABSPATH . WPINC . '/class-wp-editor.php' );
     720
     721        $wp_editor = new WP_Editor;
     722    }
     723
     724    $editor_id = 'content' . $num;
     725    ++$num;
     726
     727    $set = array(
     728        'teeny' => $teeny,
     729        'tinymce' => $settings ? $settings : true,
     730        'quicktags' => false
     731    );
     732
     733    $set = $wp_editor->parse_settings($editor_id, $set);
     734    $wp_editor->editor_settings($editor_id, $set);
    715735}
    716736
Note: See TracChangeset for help on using the changeset viewer.