Changeset 27828
- Timestamp:
- 03/28/2014 09:32:39 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-editor.php
r27810 r27828 173 173 174 174 echo '<div id="wp-' . $editor_id . '-media-buttons" class="wp-media-buttons">'; 175 do_action('media_buttons', $editor_id); 175 176 /** 177 * Fires after the default media button(s) are displayed. 178 * 179 * @since 2.5.0 180 * 181 * @param string $editor_id Unique editor identifier, e.g. 'content'. 182 */ 183 do_action( 'media_buttons', $editor_id ); 176 184 echo "</div>\n"; 177 185 } … … 181 189 } 182 190 191 /** 192 * Filter the HTML markup output that displays the editor. 193 * 194 * @since 2.1.0 195 * 196 * @param string $output Editor's HTML markup. 197 */ 183 198 $the_editor = apply_filters( 'the_editor', '<div id="wp-' . $editor_id . '-editor-container" class="wp-editor-container">' . 184 199 '<textarea' . $editor_class . $height . $tabindex . $autocomplete . ' cols="40" name="' . $set['textarea_name'] . '" ' . 185 200 'id="' . $editor_id . '">%s</textarea></div>' ); 201 202 /** 203 * Filter the default editor content. 204 * 205 * @since 2.1.0 206 * 207 * @param string $content Default editor content. 208 */ 186 209 $content = apply_filters( 'the_editor_content', $content ); 187 210 … … 221 244 $qtInit['buttons'] .= ',fullscreen'; 222 245 223 $qtInit = apply_filters('quicktags_settings', $qtInit, $editor_id); 246 /** 247 * Filter the Quicktags settings. 248 * 249 * @since 3.3.0 250 * 251 * @param array $qtInit Quicktags settings. 252 * @param string $editor_id The unique editor ID, e.g. 'content'. 253 */ 254 $qtInit = apply_filters( 'quicktags_settings', $qtInit, $editor_id ); 255 224 256 self::$qt_settings[$editor_id] = $qtInit; 225 257 … … 238 270 239 271 self::$mce_locale = $mce_locale; 272 273 /** This filter is documented in wp-admin/includes/media.php */ 240 274 $no_captions = (bool) apply_filters( 'disable_captions', '' ); 241 275 $first_run = true; … … 243 277 244 278 if ( $set['teeny'] ) { 279 280 /** 281 * Filter the list of teenyMCE plugins. 282 * 283 * @since 2.7.0 284 * 285 * @param array $plugins An array of teenyMCE plugins. 286 * @param string $editor_id Unique editor identifier, e.g. 'content'. 287 */ 245 288 self::$plugins = $plugins = apply_filters( 'teeny_mce_plugins', array( 'fullscreen', 'image', 'wordpress', 'wpeditimage', 'wplink' ), $editor_id ); 246 289 } else { 290 247 291 /** 248 * TinyMCE external plugins filter292 * Filter the list of TinyMCE external plugins. 249 293 * 250 * Takes an associative array of external plugins for TinyMCE in the form 'plugin_name' => 'url'. 251 * The url should be absolute and should include the js file name to be loaded. 252 * Example: 'myplugin' => 'http://my-site.com/wp-content/plugins/myfolder/mce_plugin.js'. 253 * If the plugin adds a button, it should be added with one of the "$mce_buttons" filters. 294 * The filter takes an associative array of external plugins for 295 * TinyMCE in the form 'plugin_name' => 'url'. 296 * 297 * The url should be absolute, and should include the js filename 298 * to be loaded. For example: 299 * 'myplugin' => 'http://mysite.com/wp-content/plugins/myfolder/mce_plugin.js'. 300 * 301 * If the external plugin adds a button, it should be added with 302 * one of the 'mce_buttons' filters. 303 * 304 * @since 2.5.0 305 * 306 * @param array $external_plugins An array of external TinyMCE plugins. 254 307 */ 255 308 $mce_external_plugins = apply_filters( 'mce_external_plugins', array() ); … … 276 329 277 330 /** 278 * TinyMCE default plugins filter331 * Filter the list of default TinyMCE plugins. 279 332 * 280 * Specifies which of the default plugins that are included in WordPress should be added to 281 * the TinyMCE instance. 333 * The filter specifies which of the default plugins included 334 * in WordPress should be added to the TinyMCE instance. 335 * 336 * @since 3.3.0 337 * 338 * @param array $plugins An array of default TinyMCE plugins. 282 339 */ 283 340 $plugins = array_unique( apply_filters( 'tiny_mce_plugins', $plugins ) ); … … 290 347 291 348 if ( ! empty( $mce_external_plugins ) ) { 349 292 350 /** 293 * This filter loads translationsfor external TinyMCE 3.x plugins.351 * Filter the translations loaded for external TinyMCE 3.x plugins. 294 352 * 295 * Takes an associative array 'plugin_name' => 'path', where path is the 296 * include path to the file. The language file should follow the same format as 297 * wp_mce_translation() and should define a variable $strings that 298 * holds all translated strings. 353 * The filter takes an associative array ('plugin_name' => 'path') 354 * where 'path' is the include path to the file. 355 * 356 * The language file should follow the same format as wp_mce_translation(), 357 * and should define a variable ($strings) that holds all translated strings. 358 * 359 * @since 2.5.0 360 * 361 * @param array $translations Translations for external TinyMCE plugins. 299 362 */ 300 363 $mce_external_languages = apply_filters( 'mce_external_languages', array() ); … … 426 489 } 427 490 491 /** 492 * Filter the comma-delimited list of stylesheets to load in TinyMCE. 493 * 494 * @since 2.1.0 495 * 496 * @param array $stylesheets Comma-delimited list of stylesheets. 497 */ 428 498 $mce_css = trim( apply_filters( 'mce_css', implode( ',', $mce_css ) ), ' ,' ); 429 499 … … 433 503 434 504 if ( $set['teeny'] ) { 505 506 /** 507 * Filter the list of teenyMCE buttons (Text tab). 508 * 509 * @since 2.7.0 510 * 511 * @param array $buttons An array of teenyMCE buttons. 512 * @param string $editor_id Unique editor identifier, e.g. 'content'. 513 */ 435 514 $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 ); 436 515 $mce_buttons_2 = $mce_buttons_3 = $mce_buttons_4 = array(); 437 516 } else { 438 $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); 439 $mce_buttons_2 = apply_filters('mce_buttons_2', array( 'formatselect', 'underline', 'alignjustify', 'forecolor', 'pastetext', 'removeformat', 'charmap', 'outdent', 'indent', 'undo', 'redo', 'wp_help' ), $editor_id); 440 $mce_buttons_3 = apply_filters('mce_buttons_3', array(), $editor_id); 441 $mce_buttons_4 = apply_filters('mce_buttons_4', array(), $editor_id); 517 518 /** 519 * Filter the first-row list of TinyMCE buttons (Visual tab). 520 * 521 * @since 2.0.0 522 * 523 * @param array $buttons First-row list of buttons. 524 * @param string $editor_id Unique editor identifier, e.g. 'content'. 525 */ 526 $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 ); 527 528 /** 529 * Filter the second-row list of TinyMCE buttons (Visual tab). 530 * 531 * @since 2.0.0 532 * 533 * @param array $buttons Second-row list of buttons. 534 * @param string $editor_id Unique editor identifier, e.g. 'content'. 535 */ 536 $mce_buttons_2 = apply_filters( 'mce_buttons_2', array( 'formatselect', 'underline', 'alignjustify', 'forecolor', 'pastetext', 'removeformat', 'charmap', 'outdent', 'indent', 'undo', 'redo', 'wp_help' ), $editor_id ); 537 538 /** 539 * Filter the third-row list of TinyMCE buttons (Visual tab). 540 * 541 * @since 2.0.0 542 * 543 * @param array $buttons Third-row list of buttons. 544 * @param string $editor_id Unique editor identifier, e.g. 'content'. 545 */ 546 $mce_buttons_3 = apply_filters( 'mce_buttons_3', array(), $editor_id ); 547 548 /** 549 * Filter the fourth-row list of TinyMCE buttons (Visual tab). 550 * 551 * @since 2.5.0 552 * 553 * @param array $buttons Fourth-row list of buttons. 554 * @param string $editor_id Unique editor identifier, e.g. 'content'. 555 */ 556 $mce_buttons_4 = apply_filters( 'mce_buttons_4', array(), $editor_id ); 442 557 } 443 558 … … 490 605 $mceInit = array_merge( $mceInit, $set['tinymce'] ); 491 606 492 // For people who really REALLY know what they're doing with TinyMCE 493 // You can modify $mceInit to add, remove, change elements of the config before tinyMCE.init 494 // Setting "valid_elements", "invalid_elements" and "extended_valid_elements" can be done through this filter. 495 // Best is to use the default cleanup by not specifying valid_elements, as TinyMCE contains full set of XHTML 1.0. 607 /* 608 * For people who really REALLY know what they're doing with TinyMCE 609 * You can modify $mceInit to add, remove, change elements of the config 610 * before tinyMCE.init. Setting "valid_elements", "invalid_elements" 611 * and "extended_valid_elements" can be done through this filter. Best 612 * is to use the default cleanup by not specifying valid_elements, 613 * as TinyMCE contains full set of XHTML 1.0. 614 */ 496 615 if ( $set['teeny'] ) { 616 617 /** 618 * Filter the teenyMCE config before init. 619 * 620 * @since 2.7.0 621 * 622 * @param array $mceInit An array with teenyMCE config. 623 * @param string $editor_id Unique editor identifier, e.g. 'content'. 624 */ 497 625 $mceInit = apply_filters( 'teeny_mce_before_init', $mceInit, $editor_id ); 498 626 } else { 627 628 /** 629 * Filter the TinyMCE config before init. 630 * 631 * @since 2.5.0 632 * 633 * @param array $mceInit An array with TinyMCE config. 634 * @param string $editor_id Unique editor identifier, e.g. 'content'. 635 */ 499 636 $mceInit = apply_filters( 'tiny_mce_before_init', $mceInit, $editor_id ); 500 637 } … … 828 965 $suffix = ( defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ) ? '' : '.min'; 829 966 967 /** 968 * Fires immediately before the TinyMCE settings are printed. 969 * 970 * @since 3.2.0 971 * 972 * @param array $mce_settings TinyMCE settings array. 973 */ 830 974 do_action( 'before_wp_tiny_mce', self::$mce_settings ); 831 975 ?> … … 862 1006 } 863 1007 864 // Allow scripts to be added after tinymce.js has been loaded but before any editor instances are created. 1008 /** 1009 * Fires after tinymce.js is loaded, but before any TinyMCE editor 1010 * instances are created. 1011 * 1012 * @since 3.9.0 1013 * 1014 * @param array $mce_settings TinyMCE settings array. 1015 */ 865 1016 do_action( 'wp_tiny_mce_init', self::$mce_settings ); 866 1017 … … 939 1090 self::wp_fullscreen_html(); 940 1091 1092 /** 1093 * Fires after any core TinyMCE editor instances are created. 1094 * 1095 * @since 3.2.0 1096 * 1097 * @param array $mce_settings TinyMCE settings array. 1098 */ 941 1099 do_action( 'after_wp_tiny_mce', self::$mce_settings ); 942 1100 } … … 979 1137 ); 980 1138 1139 /** 1140 * Filter the list of TinyMCE buttons for the fullscreen 1141 * 'Distraction Free Writing' editor. 1142 * 1143 * @since 3.2.0 1144 * 1145 * @param array $buttons An array of TinyMCE buttons for the DFW editor. 1146 */ 981 1147 $buttons = apply_filters( 'wp_fullscreen_buttons', $buttons ); 982 1148 … … 1094 1260 * @since 3.7.0 1095 1261 * 1262 * @see 'wp_link_query_args' filter 1263 * 1096 1264 * @param array $results { 1097 1265 * An associative array of query results. 1098 1266 * 1099 1267 * @type array { 1100 * @type int 'ID' The post ID. 1101 * @type string 'title' The trimmed, escaped post title. 1102 * @type string 'permalink' The post permalink. 1103 * @type string 'info' A 'Y/m/d'-formatted date for 'post' post type, the 'singular_name' post type label otherwise. 1268 * @type int $ID Post ID. 1269 * @type string $title The trimmed, escaped post title. 1270 * @type string $permalink Post permalink. 1271 * @type string $info A 'Y/m/d'-formatted date for 'post' post type, 1272 * the 'singular_name' post type label otherwise. 1104 1273 * } 1105 1274 * } 1106 * @param array $query An array of WP_Query arguments. @see 'wp_link_query_args' filter1275 * @param array $query An array of WP_Query arguments. 1107 1276 */ 1108 1277 return apply_filters( 'wp_link_query', $results, $query );
Note: See TracChangeset
for help on using the changeset viewer.