Created
December 9, 2014 03:24
-
-
Save salcode/a43940a2ab9b858f317a to your computer and use it in GitHub Desktop.
mu-plugin file that replaces the content of a page with an example demonstrating add_query_arg() does not urlencode parameters.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'the_content', 'test_add_query_arg_output' ); | |
function test_add_query_arg_output( $content ) { | |
return add_query_arg( | |
array( | |
'var_key' => 'key_value', | |
'another_var' => 'My Value' | |
), | |
home_url() | |
); | |
// value returned is | |
// http://www.example.com?var_key=key_value&another_var=My Value | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment