WP_Plugin_Dependencies::read_dependencies_from_plugin_headers()protected staticWP 6.5.0

Reads and stores dependency slugs from a plugin's 'Requires Plugins' header.

Метод класса: WP_Plugin_Dependencies{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$result = WP_Plugin_Dependencies::read_dependencies_from_plugin_headers();

Список изменений

С версии 6.5.0 Введена.

Код WP_Plugin_Dependencies::read_dependencies_from_plugin_headers() WP 6.6.2

protected static function read_dependencies_from_plugin_headers() {
	self::$dependencies     = array();
	self::$dependency_slugs = array();
	self::$dependent_slugs  = array();
	$plugins                = self::get_plugins();
	foreach ( $plugins as $plugin => $header ) {
		if ( '' === $header['RequiresPlugins'] ) {
			continue;
		}

		$dependency_slugs              = self::sanitize_dependency_slugs( $header['RequiresPlugins'] );
		self::$dependencies[ $plugin ] = $dependency_slugs;
		self::$dependency_slugs        = array_merge( self::$dependency_slugs, $dependency_slugs );

		$dependent_slug                   = self::convert_to_slug( $plugin );
		self::$dependent_slugs[ $plugin ] = $dependent_slug;
	}
	self::$dependency_slugs = array_unique( self::$dependency_slugs );
}