WC_REST_System_Status_Tools_V2_Controller::get_printable_callback_name()privateWC 1.0

Get a printable name for a callback.

Method of the class: WC_REST_System_Status_Tools_V2_Controller{}

No Hooks.

Return

String. A printable name for the callback.

Usage

// private - for code of main (parent) class only
$result = $this->get_printable_callback_name( $callback, $default );
$callback(mixed) (required)
The callback to get a name for.
$default(string) (required)
The default name, to be returned when the callback is an inline function.

WC_REST_System_Status_Tools_V2_Controller::get_printable_callback_name() code WC 8.7.0

private function get_printable_callback_name( $callback, $default ) {
	if ( is_array( $callback ) ) {
		return get_class( $callback[0] ) . '::' . $callback[1];
	}
	if ( is_string( $callback ) ) {
		return $callback;
	}

	return $default;
}