<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[27828] trunk/src/wp-includes/class-wp-editor.php: Inline documentation for hooks in wp-includes/class-wp-editor.php.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/27828">27828</a></dd>
<dt>Author</dt> <dd>DrewAPicture</dd>
<dt>Date</dt> <dd>2014-03-28 21:32:39 +0000 (Fri, 28 Mar 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Inline documentation for hooks in wp-includes/class-wp-editor.php.

Props kpdesign for some cleanup.
Fixes <a href="http://core.trac.wordpress.org/ticket/27523">#27523</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesclasswpeditorphp">trunk/src/wp-includes/class-wp-editor.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludesclasswpeditorphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/class-wp-editor.php (27827 => 27828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/class-wp-editor.php        2014-03-28 21:28:23 UTC (rev 27827)
+++ trunk/src/wp-includes/class-wp-editor.php   2014-03-28 21:32:39 UTC (rev 27828)
</span><span class="lines">@@ -172,7 +172,15 @@
</span><span class="cx">                                  include(ABSPATH . 'wp-admin/includes/media.php');
</span><span class="cx"> 
</span><span class="cx">                          echo '<div id="wp-' . $editor_id . '-media-buttons" class="wp-media-buttons">';
</span><del>-                               do_action('media_buttons', $editor_id);
</del><ins>+
+                               /**
+                                * Fires after the default media button(s) are displayed.
+                                *
+                                * @since 2.5.0
+                                *
+                                * @param string $editor_id Unique editor identifier, e.g. 'content'.
+                                */
+                               do_action( 'media_buttons', $editor_id );
</ins><span class="cx">                           echo "</div>\n";
</span><span class="cx">                  }
</span><span class="cx"> 
</span><span class="lines">@@ -180,9 +188,24 @@
</span><span class="cx">                  echo "</div>\n";
</span><span class="cx">          }
</span><span class="cx"> 
</span><ins>+               /**
+                * Filter the HTML markup output that displays the editor.
+                *
+                * @since 2.1.0
+                *
+                * @param string $output Editor's HTML markup.
+                */
</ins><span class="cx">           $the_editor = apply_filters( 'the_editor', '<div id="wp-' . $editor_id . '-editor-container" class="wp-editor-container">' .
</span><span class="cx">                  '<textarea' . $editor_class . $height . $tabindex . $autocomplete . ' cols="40" name="' . $set['textarea_name'] . '" ' .
</span><span class="cx">                  'id="' . $editor_id . '">%s</textarea></div>' );
</span><ins>+
+               /**
+                * Filter the default editor content.
+                *
+                * @since 2.1.0
+                *
+                * @param string $content Default editor content.
+                */
</ins><span class="cx">           $content = apply_filters( 'the_editor_content', $content );
</span><span class="cx"> 
</span><span class="cx">          printf( $the_editor, $content );
</span><span class="lines">@@ -220,7 +243,16 @@
</span><span class="cx">                  if ( $set['dfw'] )
</span><span class="cx">                          $qtInit['buttons'] .= ',fullscreen';
</span><span class="cx"> 
</span><del>-                       $qtInit = apply_filters('quicktags_settings', $qtInit, $editor_id);
</del><ins>+                        /**
+                        * Filter the Quicktags settings.
+                        *
+                        * @since 3.3.0
+                        *
+                        * @param array  $qtInit    Quicktags settings.
+                        * @param string $editor_id The unique editor ID, e.g. 'content'.
+                        */
+                       $qtInit = apply_filters( 'quicktags_settings', $qtInit, $editor_id );
+
</ins><span class="cx">                   self::$qt_settings[$editor_id] = $qtInit;
</span><span class="cx"> 
</span><span class="cx">                  self::$qt_buttons = array_merge( self::$qt_buttons, explode(',', $qtInit['buttons']) );
</span><span class="lines">@@ -237,20 +269,41 @@
</span><span class="cx">                          }
</span><span class="cx"> 
</span><span class="cx">                          self::$mce_locale = $mce_locale;
</span><ins>+
+                               /** This filter is documented in wp-admin/includes/media.php */
</ins><span class="cx">                           $no_captions = (bool) apply_filters( 'disable_captions', '' );
</span><span class="cx">                          $first_run = true;
</span><span class="cx">                          $ext_plugins = '';
</span><span class="cx"> 
</span><span class="cx">                          if ( $set['teeny'] ) {
</span><ins>+
+                                       /**
+                                        * Filter the list of teenyMCE plugins.
+                                        *
+                                        * @since 2.7.0
+                                        *
+                                        * @param array  $plugins   An array of teenyMCE plugins.
+                                        * @param string $editor_id Unique editor identifier, e.g. 'content'.
+                                        */
</ins><span class="cx">                                   self::$plugins = $plugins = apply_filters( 'teeny_mce_plugins', array( 'fullscreen', 'image', 'wordpress', 'wpeditimage', 'wplink' ), $editor_id );
</span><span class="cx">                          } else {
</span><ins>+
</ins><span class="cx">                                   /**
</span><del>-                                        * TinyMCE external plugins filter
</del><ins>+                                         * Filter the list of TinyMCE external plugins.
</ins><span class="cx">                                    *
</span><del>-                                        * 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 file name to be loaded.
-                                        * Example: 'myplugin' => 'http://my-site.com/wp-content/plugins/myfolder/mce_plugin.js'.
-                                        * If the plugin adds a button, it should be added with one of the "$mce_buttons" filters.
</del><ins>+                                         * 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
+                                        *
+                                        * @param array $external_plugins An array of external TinyMCE plugins.
</ins><span class="cx">                                    */
</span><span class="cx">                                  $mce_external_plugins = apply_filters( 'mce_external_plugins', array() );
</span><span class="cx"> 
</span><span class="lines">@@ -275,10 +328,14 @@
</span><span class="cx">                                  }
</span><span class="cx"> 
</span><span class="cx">                                  /**
</span><del>-                                        * TinyMCE default plugins filter
</del><ins>+                                         * Filter the list of default TinyMCE plugins.
</ins><span class="cx">                                    *
</span><del>-                                        * Specifies which of the default plugins that are included in WordPress should be added to
-                                        * the TinyMCE instance.
</del><ins>+                                         * The filter specifies which of the default plugins included
+                                        * in WordPress should be added to the TinyMCE instance.
+                                        *
+                                        * @since 3.3.0
+                                        *
+                                        * @param array $plugins An array of default TinyMCE plugins.
</ins><span class="cx">                                    */
</span><span class="cx">                                  $plugins = array_unique( apply_filters( 'tiny_mce_plugins', $plugins ) );
</span><span class="cx"> 
</span><span class="lines">@@ -289,13 +346,19 @@
</span><span class="cx">                                  }
</span><span class="cx"> 
</span><span class="cx">                                  if ( ! empty( $mce_external_plugins ) ) {
</span><ins>+
</ins><span class="cx">                                           /**
</span><del>-                                                * This filter loads translations for external TinyMCE 3.x plugins.
</del><ins>+                                                 * Filter the translations loaded for external TinyMCE 3.x plugins.
</ins><span class="cx">                                            *
</span><del>-                                                * Takes an associative array 'plugin_name' => 'path', where path is the
-                                                * include path to the file. The language file should follow the same format as
-                                                * wp_mce_translation() and should define a variable $strings that
-                                                * holds all translated strings.
</del><ins>+                                                 * The filter takes an associative array ('plugin_name' => 'path')
+                                                * where 'path' is the include path to the file.
+                                                *
+                                                * The language file should follow the same format as wp_mce_translation(),
+                                                * and should define a variable ($strings) that holds all translated strings.
+                                                *
+                                                * @since 2.5.0
+                                                *
+                                                * @param array $translations Translations for external TinyMCE plugins.
</ins><span class="cx">                                            */
</span><span class="cx">                                          $mce_external_languages = apply_filters( 'mce_external_languages', array() );
</span><span class="cx"> 
</span><span class="lines">@@ -425,6 +488,13 @@
</span><span class="cx">                                  }
</span><span class="cx">                          }
</span><span class="cx"> 
</span><ins>+                               /**
+                                * Filter the comma-delimited list of stylesheets to load in TinyMCE.
+                                *
+                                * @since 2.1.0
+                                *
+                                * @param array $stylesheets Comma-delimited list of stylesheets.
+                                */
</ins><span class="cx">                           $mce_css = trim( apply_filters( 'mce_css', implode( ',', $mce_css ) ), ' ,' );
</span><span class="cx"> 
</span><span class="cx">                          if ( ! empty($mce_css) )
</span><span class="lines">@@ -432,13 +502,58 @@
</span><span class="cx">                  }
</span><span class="cx"> 
</span><span class="cx">                  if ( $set['teeny'] ) {
</span><ins>+
+                               /**
+                                * Filter the list of teenyMCE buttons (Text tab).
+                                *
+                                * @since 2.7.0
+                                *
+                                * @param array  $buttons   An array of teenyMCE buttons.
+                                * @param string $editor_id Unique editor identifier, e.g. 'content'.
+                                */
</ins><span class="cx">                           $mce_buttons = apply_filters( 'teeny_mce_buttons', array('bold', 'italic', 'underline', 'blockquote', 'strikethrough', 'bullist', 'numlist', 'alignleft', 'aligncenter', 'alignright', 'undo', 'redo', 'link', 'unlink', 'fullscreen'), $editor_id );
</span><span class="cx">                          $mce_buttons_2 = $mce_buttons_3 = $mce_buttons_4 = array();
</span><span class="cx">                  } else {
</span><del>-                               $mce_buttons = apply_filters('mce_buttons', array('bold', 'italic', 'strikethrough', 'bullist', 'numlist', 'blockquote', 'hr', 'alignleft', 'aligncenter', 'alignright', 'link', 'unlink', 'wp_more', 'spellchecker', 'fullscreen', 'wp_adv' ), $editor_id);
-                               $mce_buttons_2 = apply_filters('mce_buttons_2', array( 'formatselect', 'underline', 'alignjustify', 'forecolor', 'pastetext', 'removeformat', 'charmap', 'outdent', 'indent', 'undo', 'redo', 'wp_help' ), $editor_id);
-                               $mce_buttons_3 = apply_filters('mce_buttons_3', array(), $editor_id);
-                               $mce_buttons_4 = apply_filters('mce_buttons_4', array(), $editor_id);
</del><ins>+
+                               /**
+                                * Filter the first-row list of TinyMCE buttons (Visual tab).
+                                *
+                                * @since 2.0.0
+                                *
+                                * @param array  $buttons   First-row list of buttons.
+                                * @param string $editor_id Unique editor identifier, e.g. 'content'.
+                                */
+                               $mce_buttons = apply_filters( 'mce_buttons', array('bold', 'italic', 'strikethrough', 'bullist', 'numlist', 'blockquote', 'hr', 'alignleft', 'aligncenter', 'alignright', 'link', 'unlink', 'wp_more', 'spellchecker', 'fullscreen', 'wp_adv' ), $editor_id );
+
+                               /**
+                                * Filter the second-row list of TinyMCE buttons (Visual tab).
+                                *
+                                * @since 2.0.0
+                                *
+                                * @param array  $buttons   Second-row list of buttons.
+                                * @param string $editor_id Unique editor identifier, e.g. 'content'.
+                                */
+                               $mce_buttons_2 = apply_filters( 'mce_buttons_2', array( 'formatselect', 'underline', 'alignjustify', 'forecolor', 'pastetext', 'removeformat', 'charmap', 'outdent', 'indent', 'undo', 'redo', 'wp_help' ), $editor_id );
+
+                               /**
+                                * Filter the third-row list of TinyMCE buttons (Visual tab).
+                                *
+                                * @since 2.0.0
+                                *
+                                * @param array  $buttons   Third-row list of buttons.
+                                * @param string $editor_id Unique editor identifier, e.g. 'content'.
+                                */
+                               $mce_buttons_3 = apply_filters( 'mce_buttons_3', array(), $editor_id );
+
+                               /**
+                                * Filter the fourth-row list of TinyMCE buttons (Visual tab).
+                                *
+                                * @since 2.5.0
+                                *
+                                * @param array  $buttons   Fourth-row list of buttons.
+                                * @param string $editor_id Unique editor identifier, e.g. 'content'.
+                                */
+                               $mce_buttons_4 = apply_filters( 'mce_buttons_4', array(), $editor_id );
</ins><span class="cx">                   }
</span><span class="cx"> 
</span><span class="cx">                  $body_class = $editor_id;
</span><span class="lines">@@ -489,13 +604,35 @@
</span><span class="cx">                  if ( is_array( $set['tinymce'] ) )
</span><span class="cx">                          $mceInit = array_merge( $mceInit, $set['tinymce'] );
</span><span class="cx"> 
</span><del>-                       // For people who really REALLY know what they're doing with TinyMCE
-                       // You can modify $mceInit to add, remove, change elements of the config before tinyMCE.init
-                       // Setting "valid_elements", "invalid_elements" and "extended_valid_elements" can be done through this filter.
-                       // Best is to use the default cleanup by not specifying valid_elements, as TinyMCE contains full set of XHTML 1.0.
</del><ins>+                        /*
+                        * For people who really REALLY know what they're doing with TinyMCE
+                        * You can modify $mceInit to add, remove, change elements of the config
+                        * before tinyMCE.init. Setting "valid_elements", "invalid_elements"
+                        * and "extended_valid_elements" can be done through this filter. Best
+                        * is to use the default cleanup by not specifying valid_elements,
+                        * as TinyMCE contains full set of XHTML 1.0.
+                        */
</ins><span class="cx">                   if ( $set['teeny'] ) {
</span><ins>+
+                               /**
+                                * Filter the teenyMCE config before init.
+                                *
+                                * @since 2.7.0
+                                *
+                                * @param array  $mceInit   An array with teenyMCE config.
+                                * @param string $editor_id Unique editor identifier, e.g. 'content'.
+                                */
</ins><span class="cx">                           $mceInit = apply_filters( 'teeny_mce_before_init', $mceInit, $editor_id );
</span><span class="cx">                  } else {
</span><ins>+
+                               /**
+                                * Filter the TinyMCE config before init.
+                                *
+                                * @since 2.5.0
+                                *
+                                * @param array  $mceInit   An array with TinyMCE config.
+                                * @param string $editor_id Unique editor identifier, e.g. 'content'.
+                                */
</ins><span class="cx">                           $mceInit = apply_filters( 'tiny_mce_before_init', $mceInit, $editor_id );
</span><span class="cx">                  }
</span><span class="cx"> 
</span><span class="lines">@@ -827,6 +964,13 @@
</span><span class="cx"> 
</span><span class="cx">          $suffix = ( defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ) ? '' : '.min';
</span><span class="cx"> 
</span><ins>+               /**
+                * Fires immediately before the TinyMCE settings are printed.
+                *
+                * @since 3.2.0
+                *
+                * @param array $mce_settings TinyMCE settings array.
+                */
</ins><span class="cx">           do_action( 'before_wp_tiny_mce', self::$mce_settings );
</span><span class="cx">          ?>
</span><span class="cx"> 
</span><span class="lines">@@ -861,7 +1005,14 @@
</span><span class="cx">                  }
</span><span class="cx">          }
</span><span class="cx"> 
</span><del>-               // Allow scripts to be added after tinymce.js has been loaded but before any editor instances are created.
</del><ins>+                /**
+                * Fires after tinymce.js is loaded, but before any TinyMCE editor
+                * instances are created.
+                *
+                * @since 3.9.0
+                *
+                * @param array $mce_settings TinyMCE settings array.
+                */
</ins><span class="cx">           do_action( 'wp_tiny_mce_init', self::$mce_settings );
</span><span class="cx"> 
</span><span class="cx">          ?>
</span><span class="lines">@@ -938,6 +1089,13 @@
</span><span class="cx">          if ( in_array( 'wpfullscreen', self::$plugins, true ) || in_array( 'fullscreen', self::$qt_buttons, true ) )
</span><span class="cx">                  self::wp_fullscreen_html();
</span><span class="cx"> 
</span><ins>+               /**
+                * Fires after any core TinyMCE editor instances are created.
+                *
+                * @since 3.2.0
+                *
+                * @param array $mce_settings TinyMCE settings array.
+                */
</ins><span class="cx">           do_action( 'after_wp_tiny_mce', self::$mce_settings );
</span><span class="cx">  }
</span><span class="cx"> 
</span><span class="lines">@@ -978,6 +1136,14 @@
</span><span class="cx">                  'help' => array( 'title' => __('Help (Alt + Shift + H)'), 'both' => false ),
</span><span class="cx">          );
</span><span class="cx"> 
</span><ins>+               /**
+                * Filter the list of TinyMCE buttons for the fullscreen
+                * 'Distraction Free Writing' editor.
+                *
+                * @since 3.2.0
+                *
+                * @param array $buttons An array of TinyMCE buttons for the DFW editor.
+                */
</ins><span class="cx">           $buttons = apply_filters( 'wp_fullscreen_buttons', $buttons );
</span><span class="cx"> 
</span><span class="cx">          foreach ( $buttons as $button => $args ) {
</span><span class="lines">@@ -1093,17 +1259,20 @@
</span><span class="cx">           *
</span><span class="cx">           * @since 3.7.0
</span><span class="cx">           *
</span><ins>+                * @see 'wp_link_query_args' filter
+                *
</ins><span class="cx">            * @param array $results {
</span><span class="cx">           *     An associative array of query results.
</span><span class="cx">           *
</span><span class="cx">           *     @type array {
</span><del>-                *         @type int    'ID'        The post ID.
-                *         @type string 'title'     The trimmed, escaped post title.
-                *         @type string 'permalink' The post permalink.
-                *         @type string 'info'      A 'Y/m/d'-formatted date for 'post' post type, the 'singular_name' post type label otherwise.
</del><ins>+                 *         @type int    $ID        Post ID.
+                *         @type string $title     The trimmed, escaped post title.
+                *         @type string $permalink Post permalink.
+                *         @type string $info      A 'Y/m/d'-formatted date for 'post' post type,
+                *                                 the 'singular_name' post type label otherwise.
</ins><span class="cx">            *     }
</span><span class="cx">           * }
</span><del>-                * @param array $query   An array of WP_Query arguments. @see 'wp_link_query_args' filter
</del><ins>+                 * @param array $query  An array of WP_Query arguments.
</ins><span class="cx">            */
</span><span class="cx">          return apply_filters( 'wp_link_query', $results, $query );
</span><span class="cx">  }
</span></span></pre>
</div>
</div>

</body>
</html>