WP_Debug_Data::get_wp_dropins()private staticWP 6.7.0

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

Method of the class: WP_Debug_Data{}

No Hooks.

Return

Array.

Usage

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

Changelog

Since 6.7.0 Introduced.

WP_Debug_Data::get_wp_dropins() code WP 6.8

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,
	);
}