[wp-trac] [WordPress Trac] #57775: wp_create_file_in_uploads Called as Action Hook

WordPress Trac noreply at wordpress.org
Tue Feb 21 01:38:26 UTC 2023


#57775: wp_create_file_in_uploads Called as Action Hook
--------------------------+-----------------------------
 Reporter:  Howdy_McGee   |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  6.1.1
 Severity:  trivial       |   Keywords:
  Focuses:  docs          |
--------------------------+-----------------------------
 The
 [https://developer.wordpress.org/reference/hooks/wp_create_file_in_uploads/
 wp_create_file_in_uploads] hook is labeled as an Action Hook in the docs
 but is actually called multiple times as a Filter Hook.

 As an Action Hook: [https://github.com/WordPress/WordPress/blob/6.1-branch
 /wp-admin/includes/class-custom-image-header.php#L871 class-custom-image-
 header.php]

 As a Filter Hook: [https://github.com/WordPress/WordPress/blob/6.1-branch
 /wp-admin/includes/ajax-actions.php#L3983 ajax-actions.php],
 [https://github.com/WordPress/WordPress/blob/6.1-branch/wp-admin/includes
 /class-custom-image-header.php#L902 class-custom-image-header.php] (and
 more)

 To keep the docs accurate, this `do_action` should be switched to an
 `apply_filters` even though, in this case, nothing will be done with the
 returned value.

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


More information about the wp-trac mailing list