wphooks.info - replace_editor

replace_editor

(trunk - 5.0-alpha-42177)

*** New in trunk ***

The hook occurs in the following 2 files

wp-admin/post-new.php:
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// Schedule auto-draft cleanup
if ( ! wp_next_scheduled( 'wp_scheduled_auto_draft_delete' ) ) {
	wp_schedule_event( time(), 'daily', 'wp_scheduled_auto_draft_delete' );
}

$post = get_default_post_to_edit( $post_type, true );
$post_ID = $post->ID;

/** This filter is documented in wp-admin/post.php */
if ( apply_filters( 'replace_editor', false, $post ) !== true ) {
	wp_enqueue_script( 'autosave' );
	include( ABSPATH . 'wp-admin/edit-form-advanced.php' );
}

include( ABSPATH . 'wp-admin/admin-footer.php' );
wp-admin/post.php:
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
	}

	/**
	 * Allows replacement of the editor.
	 *
	 * @since 4.9.0
	 *
	 * @param boolean      Whether to replace the editor. Default false.
	 * @param object $post Post object.
	 */
	if ( apply_filters( 'replace_editor', false, $post ) === true ) {
		break;
	}

	if ( ! wp_check_post_lock( $post->ID ) ) {
		$active_post_lock = wp_set_post_lock( $post->ID );

		if ( 'attachment' !== $post_type )
			wp_enqueue_script('autosave');
	}