You appear to be a bot. Output may be restricted
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 = oik_update::bw_get_slug( $plugin );
Parameters
- $plugin
- ( string ) required – a plugin name
Returns
string $slug – the slug used to identify the pluginSource
File name: oik/libs/class-oik-update.phpLines:
1 to 12 of 12
static 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