wp_editor_expand
Filters whether to enable the 'expand' functionality in the post editor.
Использование
add_filter( 'wp_editor_expand', 'wp_kama_editor_expand_filter', 10, 2 ); /** * Function for `wp_editor_expand` filter-hook. * * @param bool $expand Whether to enable the 'expand' functionality. * @param string $post_type Post type. * * @return bool */ function wp_kama_editor_expand_filter( $expand, $post_type ){ // filter... return $expand; }
- $expand(true|false)
- Whether to enable the 'expand' functionality.
По умолчанию: true - $post_type(строка)
- Post type.
Список изменений
С версии 4.0.0 | Введена. |
С версии 4.1.0 | Added the $post_type parameter. |
Где вызывается хук
В файле: /wp-admin/edit-form-advanced.php
wp_editor_expand
wp-admin/edit-form-advanced.php 60
if ( apply_filters( 'wp_editor_expand', true, $post_type ) ) {