is_gc_error()

最后更新于:2021-11-27 12:28:07

is_gc_error( mixed$thing)

Checks whether the given variable is a GeChiUI Error.

参数

$thing

(mixed) (Required) The variable to check.

响应

(bool) Whether the variable is an instance of GC_Error.

源文件

文件: gc-includes/load.php

function is_gc_error( $thing ) {
	$is_gc_error = ( $thing instanceof GC_Error );

	if ( $is_gc_error ) {
		/**
		 * Fires when `is_gc_error()` is called and its parameter is an instance of `GC_Error`.
		 *
		 * @since 5.6.0
		 *
		 * @param GC_Error $thing The error object passed to `is_gc_error()`.
		 */
		do_action( 'is_gc_error_instance', $thing );
	}

	return $is_gc_error;
}