Instantly share code, notes, and snippets.

Embed
What would you like to do?
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