Last active
June 28, 2017 15:11
-
-
Save RyanBayne/eb5c5015e4ca72ab66fedde4b1d811be to your computer and use it in GitHub Desktop.
WordPress "Current URL" Re-builder - Adds new parameters and nonce.
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
/** | |
* Create a nonced URL for returning to the current page. | |
* | |
* @param mixed $new_parameters_array | |
* | |
* @version 1.0 | |
*/ | |
function url_rebuilder_nonced( $new_parameters_array, $action, $specified_url = null ) { | |
return esc_url( | |
wp_nonce_url( | |
add_query_arg( $new_parameters_array, $specified_url ) | |
), $action | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment