WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Admin\API

Notes::maybe_add_nonce_to_url() private WC 1.0

Maybe add a nonce to a URL.

{} It's a method of the class: Notes{}

No Hooks.

Return

String. A fully formed URL.

Usage

// private - for code of main (parent) class only
$result = $this->maybe_add_nonce_to_url( $url, $action, $name ) : string;
$url(string) (required)
The URL needing a nonce.
$action(string)
The nonce action.
Default: ''
$name(string)
The nonce anme.
Default: ''

Code of Notes::maybe_add_nonce_to_url() WC 6.1.1

private function maybe_add_nonce_to_url( string $url, string $action = '', string $name = '' ) : string {
	if ( empty( $action ) ) {
		return $url;
	}

	if ( empty( $name ) ) {
		// Default paramater name.
		$name = '_wpnonce';
	}

	return add_query_arg( $name, wp_create_nonce( $action ), $url );
}