[wp-trac] [WordPress Trac] #43931: Use associative array instead of numeric for exporters and erasers

WordPress Trac noreply at wordpress.org
Wed May 2 16:17:31 UTC 2018


#43931: Use associative array instead of numeric for exporters and erasers
--------------------------+------------------------------
 Reporter:  desrosj       |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  4.9.6
Component:  General       |    Version:
 Severity:  normal        |   Keywords:  needs-patch gdpr
  Focuses:                |
--------------------------+------------------------------
 In https://core.trac.wordpress.org/ticket/43438#comment:34, it was
 suggested to use associative keys for the personal data exporters.

 I think this is a good idea and should be done (and something that has to
 be done before the first iteration of these features is released).

 Say a plugin adds their exporter, but they add it at the beginning of the
 list using `array_unshift()`. Or, a plugin just reorders the exporters. If
 a plugin hardcodes a change to the exporter at index `2`, that is now
 inconsistent.

 Using associative keys also allows things to be changed without having to
 iterate over every exporter in the list to find the one you need.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/43931>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list