_WP_Editors::editor_settings() –

You appear to be a bot. Output may be restricted

Description

Usage

_WP_Editors::editor_settings( $editor_id, $set );

Parameters

$editor_id
( string ) required – Unique editor identifier, e.g. 'content'.
$set
( array ) required – Array of editor arguments.

Returns

void

Source

File name: wordpress/wp-includes/class-wp-editor.php
Lines:

1 to 100 of 501
  public static function editor_settings( $editor_id, $set ) {
    if ( empty( self::$first_init ) ) {
      if ( is_admin() ) {
        add_action( 'admin_print_footer_scripts', array( __CLASS__, 'editor_js' ), 50 );
        add_action( 'admin_print_footer_scripts', array( __CLASS__, 'force_uncompressed_tinymce' ), 1 );
        add_action( 'admin_print_footer_scripts', array( __CLASS__, 'enqueue_scripts' ), 1 );
      } else {
        add_action( 'wp_print_footer_scripts', array( __CLASS__, 'editor_js' ), 50 );
        add_action( 'wp_print_footer_scripts', array( __CLASS__, 'force_uncompressed_tinymce' ), 1 );
        add_action( 'wp_print_footer_scripts', array( __CLASS__, 'enqueue_scripts' ), 1 );
      }
    }

    if ( self::$this_quicktags ) {

      $qtInit = array(
        'id'      => $editor_id,
        'buttons' => '',
      );

      if ( is_array( $set['quicktags'] ) ) {
        $qtInit = array_merge( $qtInit, $set['quicktags'] );
      }

      if ( empty( $qtInit['buttons'] ) ) {
        $qtInit['buttons'] = 'strong,em,link,block,del,ins,img,ul,ol,li,code,more,close';
      }

      if ( $set['_content_editor_dfw'] ) {
        $qtInit['buttons'] .= ',dfw';
      }

      
/**
 * Filters the Quicktags settings.
 *
 * @since 3.3.0
 *
 * @param array  $qtInit    Quicktags settings.
 * @param string $editor_id Unique editor identifier, e.g. 'content'.
 */
      $qtInit = apply_filters( 'quicktags_settings', $qtInit, $editor_id );

      self::$qt_settings[ $editor_id ] = $qtInit;

      self::$qt_buttons = array_merge( self::$qt_buttons, explode( ',', $qtInit['buttons'] ) );
    }

    if ( self::$this_tinymce ) {

      if ( empty( self::$first_init ) ) {
        $baseurl     = self::get_baseurl();
        $mce_locale  = self::get_mce_locale();
        $ext_plugins = '';

        if ( $set['teeny'] ) {

          
/**
 * Filters the list of teenyMCE plugins.
 *
 * @since 2.7.0
 * @since 3.3.0 The `$editor_id` parameter was added.
 *
 * @param array  $plugins   An array of teenyMCE plugins.
 * @param string $editor_id Unique editor identifier, e.g. 'content'.
 */
          $plugins = apply_filters(
            'teeny_mce_plugins',
            array(
              'colorpicker',
              'lists',
              'fullscreen',
              'image',
              'wordpress',
              'wpeditimage',
              'wplink',
            ),
            $editor_id
          );
        } else {

          
/**
 * Filters the list of TinyMCE external plugins.
 *
 * The filter takes an associative array of external plugins for
 * TinyMCE in the form 'plugin_name' => 'url'.
 *
 * The url should be absolute, and should include the js filename
 * to be loaded. For example:
 * 'myplugin' => 'http://mysite.com/wp-content/plugins/myfolder/mce_plugin.js'.
 *
 * If the external plugin adds a button, it should be added with
 * one of the 'mce_buttons' filters.
 *
 * @since 2.5.0
 * @since 5.3.0 The `$editor_id` parameter was added.
 *
 * @param array  $external_plugins An array of external TinyMCE plugins.
 * @param string $editor_id        Unique editor identifier, e.g. 'content'. Accepts 'classic-block'
 *                                 when called from block editor's Classic block.
 */
 

 View on GitHub View on Trac