plugin_sandbox_scrape()WP 3.0.0

Loads a given plugin attempt to generate errors.

Хуков нет.

Возвращает

null. Ничего (null).

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

plugin_sandbox_scrape( $plugin );
$plugin(строка) (обязательный)
Path to the plugin file relative to the plugins directory.

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

С версии 3.0.0 Введена.
С версии 4.4.0 Function was moved into the wp-admin/includes/plugin.php file.

Код plugin_sandbox_scrape() WP 6.5.2

function plugin_sandbox_scrape( $plugin ) {
	if ( ! defined( 'WP_SANDBOX_SCRAPING' ) ) {
		define( 'WP_SANDBOX_SCRAPING', true );
	}

	wp_register_plugin_realpath( WP_PLUGIN_DIR . '/' . $plugin );
	include_once WP_PLUGIN_DIR . '/' . $plugin;
}