Skip to content

Instantly share code, notes, and snippets.

@talentedaamer
Last active January 6, 2019 19:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save talentedaamer/5261911bab3814a5dd91b907b25e5725 to your computer and use it in GitHub Desktop.
Save talentedaamer/5261911bab3814a5dd91b907b25e5725 to your computer and use it in GitHub Desktop.
Get Plugin Data in WordPress
<?php
// 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