[wp-trac] [WordPress Trac] #44354: Improve `WP_Privacy_Requests_Table` to manage columns

WordPress Trac noreply at wordpress.org
Sat Mar 2 05:07:15 UTC 2019


#44354: Improve `WP_Privacy_Requests_Table` to manage columns
-------------------------------------------------+-------------------------
 Reporter:  7studio                              |       Owner:  garrett-
                                                 |  eclipse
     Type:  enhancement                          |      Status:  assigned
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Privacy                              |     Version:  4.9.6
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-refresh needs-       |     Focuses:
  testing                                        |  administration
-------------------------------------------------+-------------------------
Changes (by garrett-eclipse):

 * keywords:  has-patch needs-testing => has-patch needs-refresh needs-
               testing
 * owner:  (none) => garrett-eclipse
 * status:  new => assigned


Comment:

 Hi @birgire thank you for the patch.

 Applying it I found the table vanished and gone due to PHP errors
 exhausting memory;
 PHP Fatal error:  Allowed memory size of 268435456 bytes exhausted (tried
 to allocate 20480 bytes) in .../wp-includes/class-wp-hook.php on line 271
 Same error affected a few files. Looking deeper the cause is the update to
 `column_default` which introduced the
 "manage_{$this->request_type}_custom_column" action. The column_default
 function expects a return so returning with `apply_filter` should work.

 Reviewing the original code I believe we want to preserve the @return, as
 well as the `$cell_value = $item->$column_name;` and then apply a filter
 to that with a return call.
 *Although maybe just use `$column_name` not sure why the original code
 needed to access it from `$item`.

 An existing example in core;
 https://github.com/WordPress/WordPress/blob/56c162fbc9867f923862f64f1b4570d885f1ff03
 /wp-admin/includes/class-wp-terms-list-table.php#L579-L598

 All the best

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


More information about the wp-trac mailing list