-
-
Save talentedaamer/5261911bab3814a5dd91b907b25e5725 to your computer and use it in GitHub Desktop.
Get Plugin Data in WordPress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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