[wp-trac] [WordPress Trac] #60575: Refactor: `data_wp_context` function does not follow WP standards.

WordPress Trac noreply at wordpress.org
Mon Feb 19 16:07:39 UTC 2024


#60575: Refactor: `data_wp_context` function does not follow WP standards.
--------------------------+--------------------
 Reporter:  cbravobernal  |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  6.5
Component:  General       |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+--------------------
 As @swisspidy commented in this discussion:
 https://github.com/WordPress/gutenberg/pull/58943#discussion_r1494618835

 `data_wp_context() is the first unprefixed WordPress function in Core.

 https://github.com/WordPress/wordpress-
 develop/blob/8ee7651d0e953f0bdc5705bb5359f4067fefa89b/src/wp-includes
 /interactivity-api/interactivity-api.php#L142-L166

 Also, the function name does not indicate fully what it does. It could be
 renamed to:
  - wp_interactivity_get_context_attribute
  - wp_interactivity_context_attr
  - wp_interactivity_create_context_directive_attr

 Please feel free to discuss, I think we are on time to change it before
 6.5

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


More information about the wp-trac mailing list