Automattic\Jetpack\Autoloader\jpe7838abe751421865f42aa61338ab306
Plugin_Locator::convert_plugins_to_paths() private WC 1.0
Given an array of plugin slugs or paths, this will convert them to absolute paths and filter out the plugins that are not directory plugins. Note that array keys will also be included if they are plugin paths!
{} Это метод класса: Plugin_Locator{}
Хуков нет.
Возвращает
Строку[]
. Ничего.
Использование
// private - только в коде основоного (родительского) класса $result = $this->convert_plugins_to_paths( $plugins );
- $plugins(строка[]) (обязательный)
- Plugin paths or slugs to filter.
Код Plugin_Locator::convert_plugins_to_paths() Plugin Locator::convert plugins to paths WC 5.2.2
private function convert_plugins_to_paths( $plugins ) {
if ( ! is_array( $plugins ) || empty( $plugins ) ) {
return array();
}
// We're going to look for plugins in the standard directories.
$path_constants = array( WP_PLUGIN_DIR, WPMU_PLUGIN_DIR );
$plugin_paths = array();
foreach ( $plugins as $key => $value ) {
$path = $this->path_processor->find_directory_with_autoloader( $key, $path_constants );
if ( $path ) {
$plugin_paths[] = $path;
}
$path = $this->path_processor->find_directory_with_autoloader( $value, $path_constants );
if ( $path ) {
$plugin_paths[] = $path;
}
}
return $plugin_paths;
}