mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Editor: Add the replace_editor filter.
This filter allows the Core editor to be replaced by an entirely different editor (coughcoughGUTENBERGcough). Props azaozz, who is supposed to be on sabbatical right now. Fixes #42119. git-svn-id: https://develop.svn.wordpress.org/trunk@41829 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -63,24 +63,17 @@ if ( ! current_user_can( $post_type_object->cap->edit_posts ) || ! current_user_
|
||||
}
|
||||
|
||||
// Schedule auto-draft cleanup
|
||||
if ( ! wp_next_scheduled( 'wp_scheduled_auto_draft_delete' ) )
|
||||
if ( ! wp_next_scheduled( 'wp_scheduled_auto_draft_delete' ) ) {
|
||||
wp_schedule_event( time(), 'daily', 'wp_scheduled_auto_draft_delete' );
|
||||
|
||||
wp_enqueue_script( 'autosave' );
|
||||
|
||||
if ( is_multisite() ) {
|
||||
add_action( 'admin_footer', '_admin_notice_post_locked' );
|
||||
} else {
|
||||
$check_users = get_users( array( 'fields' => 'ID', 'number' => 2 ) );
|
||||
|
||||
if ( count( $check_users ) > 1 )
|
||||
add_action( 'admin_footer', '_admin_notice_post_locked' );
|
||||
|
||||
unset( $check_users );
|
||||
}
|
||||
|
||||
// Show post form.
|
||||
$post = get_default_post_to_edit( $post_type, true );
|
||||
$post_ID = $post->ID;
|
||||
include( ABSPATH . 'wp-admin/edit-form-advanced.php' );
|
||||
|
||||
/** 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' );
|
||||
|
||||
Reference in New Issue
Block a user