Skip to content
Docs
Get RestroPress

Filter

rpress_menu_qr_url

Updated
On this page

Filters the URL encoded in a menu QR code.

Runs at the end of RPRESS_Menu_QR::target_url() after the target page or custom URL and the optional table query argument have been set. The result is cast to a string. This hook is only reached when a valid target exists.

Available since RestroPress 3.5.

Parameters#

ParameterTypeDescription
$targetstringTarget URL.
$page_idintPage ID, or 0 when a custom URL was used.
$tablestringSanitized table label, empty if none.

Return value#

string. URL for the QR code.

Example#

function my_qr_url( $target, $page_id, $table ) {
	return add_query_arg( 'utm_source', 'qr', $target );
}
add_filter( 'rpress_menu_qr_url', 'my_qr_url', 10, 3 );

Source#

Applied in:

  • includes/features/qr-schema/class-rpress-menu-qr.php (line 176), in RPRESS_Menu_QR::target_url()

See also#

Was this page helpful?