返回WordPress使用的插件。

原型

_get_dropins()

描述

仅在is_multisite()时包含Multisite drop-ins

返回值

(array)  键是文件名。该值是一个数组,第一个值是drop-in的目的,第二个值是常量名称,对于要使用的drop-in必须为true,如果不需要常量,则为true。

源文件

路径:wp-admin/includes/plugin.php

<?php
...
function _get_dropins() {
	$dropins = array(
		'advanced-cache.php' => array( __( 'Advanced caching plugin.'       ), 'WP_CACHE' ), // WP_CACHE
		'db.php'             => array( __( 'Custom database class.'         ), true ), // auto on load
		'db-error.php'       => array( __( 'Custom database error message.' ), true ), // auto on error
		'install.php'        => array( __( 'Custom installation script.'    ), true ), // auto on installation
		'maintenance.php'    => array( __( 'Custom maintenance message.'    ), true ), // auto on maintenance
		'object-cache.php'   => array( __( 'External object cache.'         ), true ), // auto on load
	);
	if ( is_multisite() ) {
		$dropins['sunrise.php'       ] = array( __( 'Executed before Multisite is loaded.' ), 'SUNRISE' ); // SUNRISE
		$dropins['blog-deleted.php'  ] = array( __( 'Custom site deleted message.'   ), true ); // auto on deleted blog
		$dropins['blog-inactive.php' ] = array( __( 'Custom site inactive message.'  ), true ); // auto on inactive blog
		$dropins['blog-suspended.php'] = array( __( 'Custom site suspended message.' ), true ); // auto on archived or spammed blog
	}
	return $dropins;
}
...
?>

其他

英文文档:https://developer.wordpress.org/reference/functions/_get_dropins/