[wp-trac] [WordPress Trac] #52363: use_block_editor_for_post() does not check if post supports editor

WordPress Trac noreply at wordpress.org
Tue Feb 16 07:45:14 UTC 2021


#52363: use_block_editor_for_post() does not check if post supports editor
--------------------------+-----------------------------
 Reporter:  gudmdharalds  |       Owner:  (none)
     Type:  defect (bug)  |      Status:  assigned
 Priority:  normal        |   Milestone:  5.7
Component:  Editor        |     Version:  5.6
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:  administration
--------------------------+-----------------------------

Comment (by anand.au14):

 @gudmdharalds

 Function {{{use_block_editor_for_post_type}}} is calling function
 {{{use_block_editor_for_post_type}}} to check if block editor can be used
 for that post type.

 And {{{use_block_editor_for_post_type}}} is already checking if that post
 type supports editor.

 So in my opinion current patch will add a redundant check.

 Using {{{add_filter( 'use_block_editor_for_post', '__return_true' );}}} is
 like overriding the correct decision already take by WordPress to use
 block editor or not. This hook should be used to enabled block editor for
 specific post types which are needed.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/52363#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list