public
Created

  • Download Gist
wordpress-meta-data.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
<?php
# Load meta information related to this plugin file. Using current WordPress methods.
function load_plugin_meta_data() {
# Specify what headers we are looking for
$default_headers = array (
'Name' => 'Plugin Name',
'PluginURI' => 'Plugin URI',
'Version' => 'Version',
'Description' => 'Description',
'Author' => 'Author',
);
$plugin_file = pathinfo(__FILE__);
 
# Use those headers and parse our plugins meta data.
$this->plugin_meta_data = get_file_data( __FILE__ , $default_headers , 'plugin' );
$this->plugin_meta_data[ 'BaseURL' ] = WP_PLUGIN_URL . '/' . basename( $plugin_file[ 'dirname' ] );
$this->plugin_meta_data[ 'UninstallPath' ] = basename( $plugin_file[ 'dirname' ] ) . '/' . $plugin_file[ 'basename' ];
 
} # End load_plugin_meta_data()
?>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.