Opened 14 years ago
Closed 11 years ago
#15907 closed defect (bug) (wontfix)
inconsistent handling of plugin_folder in get_plugins()
Reported by: | wpmuguru | Owned by: | dd32 |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Plugins | Keywords: | has-patch 3.2-early |
Focuses: | Cc: |
Description
If you pass the name of a folder to get_plugins, it needs to have a leading slash which then stores the plugin list from that folder in $wp_plugins['/folder-name']
.
Secondly, the plugin file/path does not include folder-name passed to get_plugins, so the returned data has to have the 'folder-name/'
added to the key of each plugin's information before it can be used throughout WP. The code I'm currently using to work around the issue is
$my_plugins = get_plugins( '/extra' ); $extra = array(); if( !empty( $my_plugins ) ) { foreach( $my_plugins as $k => $v ) $extra['extra/' . $k] = $v; }
related #15906
Attachments (4)
Change History (12)
#4
@
12 years ago
15907.4.diff fixes spacing in the changed code, uses clearer concat for $plugin_files[]
.
#8
@
11 years ago
- Milestone 3.7 deleted
- Resolution set to wontfix
- Status changed from assigned to closed
- Backwards incompatible change
- The function returns data relative to
WP_PLUGINS_DIR
, or, optionally, relative toWP_PLUGINS_DIR/$folder
in the event one is passed
Anyone calling it with a folder name will know the prefix if they require it for something.
Closing as wontfix for now, but if someone can come up with an actual use-case we can re-evaluate it, I can think of no reason why a change here is needed.
Possibly related? #15853