eturn $group_path_data; } $identified_plugin = false; $possible_plugin_slugs = explode( DIRECTORY_SEPARATOR, $group_path_data['root'] ); foreach ( $possible_plugin_slugs as $key => $possible_plugin_slug ) { unset( $possible_plugin_slugs[ $key ] ); if ( ! is_dir( WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . $possible_plugin_slug ) ) { continue; } $group_path_data['root'] = trailingslashit( WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . $possible_plugin_slug ); $identified_plugin = true; break; } if ( ! $identified_plugin ) { $group_path_data['root'] = $following_symlinks_root; self::$cached_paths[ $group_path_data['root'] ] = $group_path_data['root']; return $group_path_data; } if ( ! empty( $possible_plugin_slugs ) ) { foreach ( $possible_plugin_slugs as $path_part ) { if ( ! is_dir( $group_path_data['root'] . $path_part ) ) { continue; } $group_path_data['root'] = trailingslashit( $group_path_data['root'] . $path_part ); } } self::$cached_paths[ $group_path_data['root'] ] = $group_path_data['root']; return $group_path_data; } } eturn $group_path_data; } $identified_plugin = false; $possible_plugin_slugs = explode( DIRECTORY_SEPARATOR, $group_path_data['root'] ); foreach ( $possible_plugin_slugs as $key => $possible_plugin_slug ) { unset( $possible_plugin_slugs[ $key ] ); if ( ! is_dir( WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . $possible_plugin_slug ) ) { continue; } $group_path_data['root'] = trailingslashit( WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . $possible_plugin_slug ); $identified_plugin = true; break; } if ( ! $identified_plugin ) { $group_path_data['root'] = $following_symlinks_root; self::$cached_paths[ $group_path_data['root'] ] = $group_path_data['root']; return $group_path_data; } if ( ! empty( $possible_plugin_slugs ) ) { foreach ( $possible_plugin_slugs as $path_part ) { if ( ! is_dir( $group_path_data['root'] . $path_part ) ) { continue; } $group_path_data['root'] = trailingslashit( $group_path_data['root'] . $path_part ); } } self::$cached_paths[ $group_path_data['root'] ] = $group_path_data['root']; return $group_path_data; } }