Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #52050, comment 18


Ignore:
Timestamp:
03/16/2021 09:12:51 AM (5 years ago)
Author:
mkdgs

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #52050, comment 18

    initial v1  
    1212* use wp_editor_fix(..) instead wp_editor(...)
    1313*/
    14 function wp_editor_fix($content, $id, $options)
     14function wp_editor_fix($content, $editor_id, $settings = array() )
    1515{     
    1616    ob_start();
    17     wp_editor($content, $id, $options);
     17    wp_editor($content, $editor_id, $settings);
    1818    $out = ob_get_contents();
    1919    $js = json_encode($out);
    20     $id_editor_ctn  = $id.'-ctn';
     20    $id_editor_ctn  = $editor_id.'-ctn';
    2121    ob_clean(); ?>
    2222    <div id="<?php echo $id_editor_ctn?>"></div>
     
    2828            // init editor
    2929            setTimeout(function() {
    30                 // get the editor button and simulate a click on it
    31                 jQuery('#<?php echo $id ?>-tmce').trigger('click');
     30                jQuery('#<?php echo $editor_id ?>-tmce').trigger('click');
    3231            },   10);
    3332    }, 50);