WC_Tracks::get_properties()public staticWC 1.0

Get all properties for the event including filtered and identity properties.

Метод класса: WC_Tracks{}

Хуки из метода

Возвращает

Массив.

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

$result = WC_Tracks::get_properties( $event_name, $event_properties );
$event_name(строка) (обязательный)
Event name.
$event_properties(массив) (обязательный)
Event specific properties.

Код WC_Tracks::get_properties() WC 8.7.0

public static function get_properties( $event_name, $event_properties ) {
	/**
	 * Allow event props to be filtered to enable adding site-wide props.
	 *
	 * @since 4.1.0
	 */
	$properties = apply_filters( 'woocommerce_tracks_event_properties', $event_properties, $event_name );
	$user       = wp_get_current_user();
	$identity   = WC_Tracks_Client::get_identity( $user->ID );

	// Delete _ui and _ut protected properties.
	unset( $properties['_ui'] );
	unset( $properties['_ut'] );

	$data = $event_name
		? array(
			'_en' => $event_name,
			'_ts' => WC_Tracks_Client::build_timestamp(),
		)
		: array();

	$server_details = self::get_server_details();
	$blog_details   = self::get_blog_details( $user->ID );

	return array_merge( $properties, $data, $server_details, $identity, $blog_details );
}