Skip to content

Instantly share code, notes, and snippets.

@talentedaamer talentedaamer/plugin-root-file.php Secret
Last active Jan 6, 2019

What would you like to do?
Get Plugin Data in WordPress
// check if is admin
if ( is_admin() ) {
// check if get_plugin_data() function exists
if( ! function_exists('get_plugin_data') ){
// include the plugin file from wordpress core
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
// get plugin data.
$plugin_data = get_plugin_data( __FILE__, false,false );
// print plugin data
echo "<pre>";
print_r( $plugin_data );
echo "</pre>";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.