Automattic\WooCommerce\Internal\MCP
McpEndpointRemoval::handle_activated_plugin
Handle the activated_plugin hook.
When the MCP Adapter plugin is activated from the removal notice's link, the store has acted on the notice, so delete the old feature option that triggers it for every admin.
Метод класса: McpEndpointRemoval{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$McpEndpointRemoval = new McpEndpointRemoval(); $McpEndpointRemoval->handle_activated_plugin( $plugin ): void;
- $plugin(разное) (обязательный)
- Path to the activated plugin file, relative to the plugins directory.
Код McpEndpointRemoval::handle_activated_plugin() McpEndpointRemoval::handle activated plugin WC 11.3.0
public function handle_activated_plugin( $plugin ): void {
// Core verified the activation nonce before activating; the argument only identifies where the activation started.
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
if ( self::ADAPTER_PLUGIN_FILE === $plugin && isset( $_GET[ self::NOTICE_ACTIVATION_ARG ] ) ) {
delete_option( self::FEATURE_OPTION );
}
}