Changeset 41558 for trunk/src/wp-includes/general-template.php
- Timestamp:
- 09/21/2017 11:03:06 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/general-template.php
r41376 r41558 3126 3126 * Args. 3127 3127 * 3128 * @type string $type The MIME type of the file to be edited. 3129 * @type string $file Filename to be edited. Extension is used to sniff the type. Can be supplied as alternative to `$type` param. 3130 * @type array $settings Settings to merge on top of defaults which derive from `$type` or `$file` args. 3131 * @type WP_Theme $theme Theme being edited when on theme editor. 3132 * @type string $plugin Plugin being edited when on plugin editor. 3128 * @type string $type The MIME type of the file to be edited. 3129 * @type string $file Filename to be edited. Extension is used to sniff the type. Can be supplied as alternative to `$type` param. 3130 * @type WP_Theme $theme Theme being edited when on theme editor. 3131 * @type string $plugin Plugin being edited when on plugin editor. 3132 * @type array $codemirror Additional CodeMirror setting overrides. 3133 * @type array $csslint CSSLint rule overrides. 3134 * @type array $jshint JSHint rule overrides. 3135 * @type array $htmlhint JSHint rule overrides. 3133 3136 * } 3134 3137 * @returns array|false Settings for the enqueued code editor, or false if the editor was not enqueued . … … 3409 3412 3410 3413 // Let settings supplied via args override any defaults. 3411 if ( isset( $args['settings'] ) ) { 3412 foreach ( $args['settings'] as $key => $value ) { 3413 $settings[ $key ] = array_merge( 3414 $settings[ $key ], 3415 $value 3416 ); 3417 } 3414 foreach ( wp_array_slice_assoc( $args, array( 'codemirror', 'csslint', 'jshint', 'htmlhint' ) ) as $key => $value ) { 3415 $settings[ $key ] = array_merge( 3416 $settings[ $key ], 3417 $value 3418 ); 3418 3419 } 3419 3420 … … 3429 3430 * Args passed when calling `wp_enqueue_code_editor()`. 3430 3431 * 3431 * @type string $type The MIME type of the file to be edited. 3432 * @type string $file Filename being edited. 3433 * @type array $settings Settings to merge on top of defaults which derive from `$type` or `$file` args. 3434 * @type WP_Theme $theme Theme being edited when on theme editor. 3435 * @type string $plugin Plugin being edited when on plugin editor. 3432 * @type string $type The MIME type of the file to be edited. 3433 * @type string $file Filename being edited. 3434 * @type WP_Theme $theme Theme being edited when on theme editor. 3435 * @type string $plugin Plugin being edited when on plugin editor. 3436 * @type array $codemirror Additional CodeMirror setting overrides. 3437 * @type array $csslint CSSLint rule overrides. 3438 * @type array $jshint JSHint rule overrides. 3439 * @type array $htmlhint JSHint rule overrides. 3436 3440 * } 3437 3441 */ … … 3444 3448 wp_enqueue_script( 'code-editor' ); 3445 3449 wp_enqueue_style( 'code-editor' ); 3446 3447 wp_enqueue_script( 'codemirror' );3448 wp_enqueue_style( 'codemirror' );3449 3450 3450 3451 if ( isset( $settings['codemirror']['mode'] ) ) {
Note: See TracChangeset
for help on using the changeset viewer.