Last updated July 11, 2026, Version 0.34
Short-circuit filter for wp_get_referer() during testing.
Allows tests to completely bypass wp_get_referer() and provide their own referer values. Only available during unit tests for security. Return a non-null value to short-circuit.
Auto-generated Example
add_filter(
'gatherpress_pre_get_wp_referer',
function( string|false $pre_value = null ) {
// Your code here.
return null;
}
);
Parameters
string|false|null$pre_valuePre-value to return instead of using wp_get_referer().
Files
apply_filters( 'gatherpress_pre_get_wp_referer', null )