Parse the plugin contents to retrieve plugin's metadata. NOTE This function only works in the admin area.
The metadata of the plugin's data searches for the following in the plugin's header. All plugin data must be on its own line. For plugin description, it must not have any newlines or only parts of the description will be displayed and the same goes for the plugin data.
Plugin data returned array contains the following:
<?php get_plugin_data( $plugin_file, $markup = true, $translate = true ) ?>
$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', );
Since: 1.5.0
get_plugin_data() is located in wp-admin/includes/plugin.php
.