[wp-trac] [WordPress Trac] #30536: Trying to filter show_advanced_plugins doesn't work correctly
WordPress Trac
noreply at wordpress.org
Fri Nov 28 00:01:49 UTC 2014
#30536: Trying to filter show_advanced_plugins doesn't work correctly
----------------------------+-----------------------------
Reporter: jkmassel | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Plugins | Version: 4.0.1
Severity: normal | Keywords:
Focuses: administration |
----------------------------+-----------------------------
I have the following filter on show_advanced_plugins:
{{{
add_filter('show_advanced_plugins', function($true_or_false, $type){
if($type == 'mustuse'){
return false;
}
return true;
});
}}}
The problem is, $type is never passed to this function.
One (probably awful) way to fix it is to modify plugin.php, line 214:
$value = call_user_func_array($the_['function'], array_slice($args, 1,
(int) $the_['accepted_args']));
Changing (int) $the_['accepted_args'] to count($args) - 1 made it so $type
was populated, but caused other warnings in the admin area, if that's
helpful.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/30536>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list