WP_Debug_Data::get_wp_dropinsprivate staticWP 6.7.0

Gets the WordPress drop-in section of the debug data.

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

Хуков нет.

Возвращает

Массив<Строку,. string|bool|array> The drop-ins debug data.

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

$result = WP_Debug_Data::get_wp_dropins(): array;

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

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

Код WP_Debug_Data::get_wp_dropins() WP 7.0.2

private static function get_wp_dropins(): array {
	// Get a list of all drop-in replacements.
	$dropins = get_dropins();

	// Get drop-ins descriptions.
	$dropin_descriptions = _get_dropins();

	$fields = array();
	foreach ( $dropins as $dropin_key => $dropin ) {
		$fields[ sanitize_text_field( $dropin_key ) ] = array(
			'label' => $dropin_key,
			'value' => $dropin_descriptions[ $dropin_key ][0],
			'debug' => 'true',
		);
	}

	return array(
		'label'       => __( 'Drop-ins' ),
		'show_count'  => true,
		'description' => sprintf(
			/* translators: %s: wp-content directory name. */
			__( 'Drop-ins are single files, found in the %s directory, that replace or enhance WordPress features in ways that are not possible for traditional plugins.' ),
			'<code>' . str_replace( ABSPATH, '', WP_CONTENT_DIR ) . '</code>'
		),
		'fields'      => $fields,
	);
}