@@ -17,6 +17,7 @@ class PluginProperties extends BaseProperties
1717 * Custom properties for Plugins.
1818 */
1919 public const PROP_NETWORK = 'network ' ;
20+ public const PROP_REQUIRES_PLUGINS = 'requiresPlugins ' ;
2021 /**
2122 * Available methods of Properties::__call()
2223 * from plugin headers.
@@ -37,6 +38,7 @@ class PluginProperties extends BaseProperties
3738
3839 // additional headers
3940 self ::PROP_NETWORK => 'Network ' ,
41+ self ::PROP_REQUIRES_PLUGINS => 'RequiresPlugins ' ,
4042 ];
4143
4244 /**
@@ -84,7 +86,7 @@ protected function __construct(string $pluginMainFile)
8486 if (!function_exists ('get_plugin_data ' )) {
8587 require_once ABSPATH . 'wp-admin/includes/plugin.php ' ;
8688 }
87-
89+
8890 // $markup = false, to avoid an incorrect early wptexturize call. Also we probably don't want HTML here anyway
8991 // @see https://core.trac.wordpress.org/ticket/49965
9092 $ pluginData = get_plugin_data ($ pluginMainFile , false );
@@ -129,6 +131,16 @@ public function network(): bool
129131 return (bool ) $ this ->get (self ::PROP_NETWORK , false );
130132 }
131133
134+ /**
135+ * @return array
136+ */
137+ public function requiresPlugins (): array
138+ {
139+ $ value = $ this ->get (self ::PROP_REQUIRES_PLUGINS );
140+
141+ return $ value && is_string ($ value ) ? explode (', ' , $ value ) : [];
142+ }
143+
132144 /**
133145 * @return bool
134146 */
0 commit comments