[wp-trac] [WordPress Trac] #16502: Quick Edit contents should only be rendered if quick edit button in actions after filtering

WordPress Trac noreply at wordpress.org
Tue Apr 5 18:59:02 UTC 2022


#16502: Quick Edit contents should only be rendered if quick edit button in actions
after filtering
-------------------------------------+-----------------------------
 Reporter:  wyrfel                   |       Owner:  chriscct7
     Type:  enhancement              |      Status:  reviewing
 Priority:  normal                   |   Milestone:  Future Release
Component:  Quick/Bulk Edit          |     Version:  3.0.4
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:
-------------------------------------+-----------------------------
Changes (by sabernhardt):

 * keywords:  has-patch => has-patch needs-testing
 * milestone:   => Future Release


Old description:

> _the_post() has a static call to get_inline_data() to generate the
> quick_edit content. This happens even if after running the (undocumented)
> 'post_row_actions' filters the Quick-Edit link ($actions['inline hide-if-
> no-js']) is not amongst the actions anymore.
>
> Prefixing the get_inline_data() call with
> {{{
> if (isset($actions['inline hide-if-no-js'])
> }}}
> would be a simple solution, enabling people to cancel the performance-
> impacting quick-edit form generation alltogether.

New description:

 `_the_post()` has a static call to `get_inline_data()` to generate the
 `quick_edit` content. This happens even if after running the
 (undocumented) `post_row_actions` filters the Quick-Edit link
 (`$actions['inline hide-if-no-js']`) is not amongst the actions anymore.

 Prefixing the `get_inline_data()` call with
 {{{
 if (isset($actions['inline hide-if-no-js'])
 }}}
 would be a simple solution, enabling people to cancel the performance-
 impacting quick-edit form generation alltogether.

--

Comment:

 Also, Core disables quick edit for (reusable) blocks.

 Sample filter to use for testing other post types:
 {{{
 add_filter( 'post_row_actions', 'list_row_actions_remove_quick_edit', 10,
 1 );
 function list_row_actions_remove_quick_edit( $actions ) {
         unset( $actions['inline hide-if-no-js'] );

         return $actions;
 }
 }}}

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


More information about the wp-trac mailing list