Description
Return the slug part of a plugin nameThis function should only be called when we know it's a plugin name with a directory. Sample results
- "slug" for "slug/plugin_name.php" – when called for "update-check"
- "slugonly" for "slugonly" – when called for "plugin_information"
- "hello" for "hello.php" – does this ever happen?
- null for null
Usage
$string = bw_get_slug( $plugin );Parameters
- $plugin
- ( string ) required – a plugin name
Returns
string $slug – the slug used to identify the pluginSource
File name: oik/admin/oik-admin.phpLines:
1 to 12 of 12
function bw_get_slug( $plugin ) { if ( $plugin ) { $pathinfo = pathinfo( $plugin ); $slug = $pathinfo['dirname'] ; if ( $slug == '.' ) { $slug = $pathinfo['filename']; } } else { $slug = null; } return( $slug ); }View on GitHub View on Trac
Called by
1 to 3 of 3
