Created
April 3, 2016 11:59
-
-
Save hsleonis/388b0b76cd6983a345c5b861151acb26 to your computer and use it in GitHub Desktop.
Parse the plugin contents to retrieve plugin's metadata
This file contains hidden or 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 | |
| /** | |
| * Parse the plugin contents to retrieve plugin's metadata | |
| * Works only in wp-admin | |
| * Reference: https://codex.wordpress.org/Function_Reference/get_plugin_data | |
| */ | |
| get_plugin_data( $plugin_file, $markup = true, $translate = true ); | |
| /* | |
| Return value: | |
| $default_headers = array( | |
| 'Name' => 'Plugin Name', | |
| 'PluginURI' => 'Plugin URI', | |
| 'Version' => 'Version', | |
| 'Description' => 'Description', | |
| 'Author' => 'Author', | |
| 'AuthorURI' => 'Author URI', | |
| 'TextDomain' => 'Text Domain', | |
| 'DomainPath' => 'Domain Path', | |
| 'Network' => 'Network', | |
| // Site Wide Only is deprecated in favor of Network. | |
| '_sitewide' => 'Site Wide Only', | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment