You appear to be a bot. Output may be restricted
Description
Return the plugin versionNote: get_plugin_data() may not find a plugin that's been renamed ( plugin folder or file ) and it doesn't check that the plugin is present, so we do here.
Usage
$string|null = _bw_get_plugin_version( $plugin_name );
Parameters
- $plugin_name
- ( string ) required – expected form "plugin/plugin.php"
Returns
string|null plugin version or nullSource
File name: oik/libs/oik_plugins.phpLines:
1 to 14 of 14
function _bw_get_plugin_version( $plugin_name ) { $file = WP_PLUGIN_DIR . '/'. $plugin_name; $version = null; if ( file_exists( $file ) ) { require_once( ABSPATH . "wp-admin/includes/plugin.php" ); $plugin_data = get_plugin_data( $file, false, false ); // We assume get_plugins() is loaded since we're doing admin stuff! //$plugin_folder = get_plugins( $plugin_name ); //bw_trace2( $plugin_folder, "plugin_folder" ); //$plugin_data = bw_array_get( $plugin_folder, $plugin_name, null ); $version = bw_array_get( $plugin_data, 'Version', null ); } return( $version ); }View on GitHub View on Trac