WP_Debug_Data::get_wp_paths_sizes()private staticWP 6.7.0

Gets the WordPress paths and sizes section of the debug data.

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

Хуков нет.

Возвращает

Массив|null. Paths and sizes debug data for single sites, otherwise null for multi-site installs.

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

$result = WP_Debug_Data::get_wp_paths_sizes(): ?array;

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

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

Код WP_Debug_Data::get_wp_paths_sizes() WP 6.7.1

private static function get_wp_paths_sizes(): ?array {
	if ( is_multisite() ) {
		return null;
	}

	$loading = __( 'Loading…' );

	$fields = array(
		'wordpress_path' => array(
			'label' => __( 'WordPress directory location' ),
			'value' => untrailingslashit( ABSPATH ),
		),
		'wordpress_size' => array(
			'label' => __( 'WordPress directory size' ),
			'value' => $loading,
			'debug' => 'loading...',
		),
		'uploads_path'   => array(
			'label' => __( 'Uploads directory location' ),
			'value' => wp_upload_dir()['basedir'],
		),
		'uploads_size'   => array(
			'label' => __( 'Uploads directory size' ),
			'value' => $loading,
			'debug' => 'loading...',
		),
		'themes_path'    => array(
			'label' => __( 'Themes directory location' ),
			'value' => get_theme_root(),
		),
		'themes_size'    => array(
			'label' => __( 'Themes directory size' ),
			'value' => $loading,
			'debug' => 'loading...',
		),
		'plugins_path'   => array(
			'label' => __( 'Plugins directory location' ),
			'value' => WP_PLUGIN_DIR,
		),
		'plugins_size'   => array(
			'label' => __( 'Plugins directory size' ),
			'value' => $loading,
			'debug' => 'loading...',
		),
		'fonts_path'     => array(
			'label' => __( 'Fonts directory location' ),
			'value' => wp_get_font_dir()['basedir'],
		),
		'fonts_size'     => array(
			'label' => __( 'Fonts directory size' ),
			'value' => $loading,
			'debug' => 'loading...',
		),
		'database_size'  => array(
			'label' => __( 'Database size' ),
			'value' => $loading,
			'debug' => 'loading...',
		),
		'total_size'     => array(
			'label' => __( 'Total installation size' ),
			'value' => $loading,
			'debug' => 'loading...',
		),
	);

	return array(
		/* translators: Filesystem directory paths and storage sizes. */
		'label'  => __( 'Directories and Sizes' ),
		'fields' => $fields,
	);
}