Skip to content

Instantly share code, notes, and snippets.

@RyanBayne
Last active June 28, 2017 15:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RyanBayne/eb5c5015e4ca72ab66fedde4b1d811be to your computer and use it in GitHub Desktop.
Save RyanBayne/eb5c5015e4ca72ab66fedde4b1d811be to your computer and use it in GitHub Desktop.
WordPress "Current URL" Re-builder - Adds new parameters and nonce.
/**
* 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