wphooks.info - wp_editor_expand

wp_editor_expand

(trunk - 5.1-alpha-44286)

The hook occurs in the following file:

wp-admin/edit-form-advanced.php:
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
 * Filters whether to enable the 'expand' functionality in the post editor.
 *
 * @since 4.0.0
 * @since 4.1.0 Added the `$post_type` parameter.
 *
 * @param bool   $expand    Whether to enable the 'expand' functionality. Default true.
 * @param string $post_type Post type.
 */
if ( post_type_supports( $post_type, 'editor' ) && ! wp_is_mobile() &&
	! ( $is_IE && preg_match( '/MSIE [5678]/', $_SERVER['HTTP_USER_AGENT'] ) ) &&
	apply_filters( 'wp_editor_expand', true, $post_type ) ) {

	wp_enqueue_script( 'editor-expand' );
	$_content_editor_dfw = true;
	$_wp_editor_expand   = ( get_user_setting( 'editor_expand', 'on' ) === 'on' );
}

if ( wp_is_mobile() ) {
	wp_enqueue_script( 'jquery-touch-punch' );
}