[wp-trac] [WordPress Trac] #49599: Wrong PHPDoc wp_get_active_and_valid_plugins

WordPress Trac noreply at wordpress.org
Sun Mar 8 14:08:07 UTC 2020


#49599: Wrong PHPDoc wp_get_active_and_valid_plugins
--------------------------+-----------------------------
 Reporter:  herrvigg      |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Plugins       |    Version:  5.3.2
 Severity:  normal        |   Keywords:
  Focuses:  docs          |
--------------------------+-----------------------------
 I found a misleading error in the documentation of
 wp_get_active_and_valid_plugins (in wp-includes/load.php):
 {{{#!php
 <?php
 * @return string[] $plugin_file Array of paths to plugin files relative to
 the plugins directory.
 */
 function wp_get_active_and_valid_plugins() {
 }}}

 This is wrong, the plugin files are returned as **absolute path - not
 relative**. The files are returned as follows:
 {{{#!php
 <?php
 $plugins[] = WP_PLUGIN_DIR . '/' . $plugin;
 }}}

 This is not very consistent with the rest of the API working rather with
 relative paths, but changing the code would break many plugins for sure.
 The documentation should be updated.

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


More information about the wp-trac mailing list