wp_nonce_url

The timeline below displays how wordpress function wp_nonce_url has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.1

/**
 * Retrieves URL with nonce added to URL query.
 *
 * @since 2.0.4
 *
 * @param string     $actionurl URL to add nonce action.
 * @param int|string $action    Optional. Nonce action name. Default -1.
 * @param string     $name      Optional. Nonce name. Default '_wpnonce'.
 * @return string Escaped URL with nonce action added.
 */
function wp_nonce_url($actionurl, $action = -1, $name = '_wpnonce')
{
    $actionurl = str_replace('&', '&', $actionurl);
    return esc_html(add_query_arg($name, wp_create_nonce($action), $actionurl));
}

WordPress Version: 4.1

/**
 * Retrieve URL with nonce added to URL query.
 *
 * @since 2.0.4
 *
 * @param string     $actionurl URL to add nonce action.
 * @param int|string $action    Optional. Nonce action name. Default -1.
 * @param string     $name      Optional. Nonce name. Default '_wpnonce'.
 * @return string Escaped URL with nonce action added.
 */
function wp_nonce_url($actionurl, $action = -1, $name = '_wpnonce')
{
    $actionurl = str_replace('&', '&', $actionurl);
    return esc_html(add_query_arg($name, wp_create_nonce($action), $actionurl));
}

WordPress Version: 4.0

/**
 * Retrieve URL with nonce added to URL query.
 *
 * @since 2.0.4
 *
 * @param string $actionurl URL to add nonce action.
 * @param string $action    Optional. Nonce action name. Default -1.
 * @param string $name      Optional. Nonce name. Default '_wpnonce'.
 * @return string Escaped URL with nonce action added.
 */
function wp_nonce_url($actionurl, $action = -1, $name = '_wpnonce')
{
    $actionurl = str_replace('&', '&', $actionurl);
    return esc_html(add_query_arg($name, wp_create_nonce($action), $actionurl));
}

WordPress Version: 3.9

/**
 * Retrieve URL with nonce added to URL query.
 *
 * @since 2.0.4
 *
 * @param string $actionurl URL to add nonce action.
 * @param string $action Optional. Nonce action name.
 * @param string $name Optional. Nonce name.
 * @return string Escaped URL with nonce action added.
 */
function wp_nonce_url($actionurl, $action = -1, $name = '_wpnonce')
{
    $actionurl = str_replace('&', '&', $actionurl);
    return esc_html(add_query_arg($name, wp_create_nonce($action), $actionurl));
}

WordPress Version: 3.7

/**
 * Retrieve URL with nonce added to URL query.
 *
 * @package WordPress
 * @subpackage Security
 * @since 2.0.4
 *
 * @param string $actionurl URL to add nonce action.
 * @param string $action Optional. Nonce action name.
 * @param string $name Optional. Nonce name.
 * @return string URL with nonce action added.
 */
function wp_nonce_url($actionurl, $action = -1, $name = '_wpnonce')
{
    $actionurl = str_replace('&', '&', $actionurl);
    return esc_html(add_query_arg($name, wp_create_nonce($action), $actionurl));
}