Filter
rpress_menu_qr_url
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#
| Parameter | Type | Description |
|---|---|---|
$target | string | Target URL. |
$page_id | int | Page ID, or 0 when a custom URL was used. |
$table | string | Sanitized 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), inRPRESS_Menu_QR::target_url()
See also#
Was this page helpful?
