PluginProbe
Extendify / 0.2.0
Extendify v0.2.0
3.2.1 3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 0.6.0 All 127 releases
extendify / app / Plugin.php

Plugin.php in Extendify 0.2.0, at app/Plugin.php

35 lines 795 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // phpcs:ignoreFile
3 // This class was copied from JetPack (mostly)
4 // so will be a bit of work to refactor
5 /**
6 * Manage plugin dependencies
7 */
8
9 namespace Extendify\Library;
10
11 class Plugin
12 {
13 /**
14 * Will return info about a plugin
15 *
16 * @param string $identifier The key of the plugin info.
17 * @param string $plugin_id The plugin identifier string.
18 * @return string
19 */
20 public static function getPluginInfo($identifier, $plugin_id)
21 {
22 if (!function_exists('get_plugins')) {
23 include_once ABSPATH . 'wp-admin/includes/plugin.php';
24 }
25
26 foreach (get_plugins() as $plugin => $data) {
27 if ($data[$identifier] === $plugin_id) {
28 return $plugin;
29 }
30 }
31
32 return false;
33 }
34 }
35