[wp-trac] [WordPress Trac] #49449: Wrong require_once and misleading comment

WordPress Trac noreply at wordpress.org
Sun Feb 16 19:08:56 UTC 2020


#49449: Wrong require_once and misleading comment
--------------------------+-----------------------------
 Reporter:  luisrivera    |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  REST API      |    Version:  5.3
 Severity:  normal        |   Keywords:
  Focuses:  rest-api      |
--------------------------+-----------------------------
 Location: class-wp-rest-attachments-controller.php, lines 167 - 168
 [https://core.trac.wordpress.org/browser/tags/5.3/src/wp-includes/rest-
 api/endpoints/class-wp-rest-attachments-controller.php#L167]

 {{{#!php
 <?php
 // Include admin function to get access to
 wp_generate_attachment_metadata().
 require_once ABSPATH . 'wp-admin/includes/media.php';
 }}}

 **wp_generate_attachment_metadata()** is actually located in 'wp-
 admin/includes/image.php'
 [https://core.trac.wordpress.org/browser/tags/5.3/src/wp-
 admin/includes/image.php#L458]

 This isn't breaking because the correct file is being required_once before
 by ('insert_attachment') another method in the same class but this should
 be corrected.

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


More information about the wp-trac mailing list