WP_Plugin_Dependencies::get_dependency_filepaths()
Gets the filepath of installed dependencies. If a dependency is not installed, the filepath defaults to false.
Method of the class: WP_Plugin_Dependencies{}
No Hooks.
Return
Array
. An array of install dependencies filepaths, relative to the plugins directory.
Usage
$result = WP_Plugin_Dependencies::get_dependency_filepaths();
Changelog
Since 6.5.0 | Introduced. |
WP_Plugin_Dependencies::get_dependency_filepaths() WP Plugin Dependencies::get dependency filepaths code WP 6.7.1
protected static function get_dependency_filepaths() { if ( is_array( self::$dependency_filepaths ) ) { return self::$dependency_filepaths; } if ( null === self::$dependency_slugs ) { return array(); } self::$dependency_filepaths = array(); $plugin_dirnames = self::get_plugin_dirnames(); foreach ( self::$dependency_slugs as $slug ) { if ( isset( $plugin_dirnames[ $slug ] ) ) { self::$dependency_filepaths[ $slug ] = $plugin_dirnames[ $slug ]; continue; } self::$dependency_filepaths[ $slug ] = false; } return self::$dependency_filepaths; }