/** * Retrieves plugin data from cache if it exists. * * @param string $plugin_path Path to plugin header file. * * @return array|null Plugin data or null. */ public function get_cached_plugin_data($plugin_path) { $plugin_basename = plugin_basename($plugin_path); if (!array_key_exists($plugin_basename, $this->plugin_data)) { $this->plugin_data[$plugin_basename] = Tribe__Utils__Plugins::get_plugin_data($plugin_path); } return $this->plugin_data[$plugin_basename]; }
/** * Gets the plugin data from the plugin file header * * This is somewhat resource intensive, so data is stored in $args * in case of subsequent calls. * * @see get_plugin_data() for WP Admin only function this is similar to. * * @return array Plugin data; keys match capitalized file header declarations. */ public final function get_plugin_data() { $plugin_data = $this->get('plugin_data'); // Set the plugin data arg/cache to match. if (empty($plugin_data)) { $plugin_data = $this->set('plugin_data', Tribe__Utils__Plugins::get_plugin_data($this->get_plugin_file())); } return $plugin_data; }