wp_ajax_sample_permalink

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

WordPress Version: 6.3

/**
 * Handles retrieving a sample permalink via AJAX.
 *
 * @since 3.1.0
 */
function wp_ajax_sample_permalink()
{
    check_ajax_referer('samplepermalink', 'samplepermalinknonce');
    $post_id = isset($_POST['post_id']) ? (int) $_POST['post_id'] : 0;
    $title = isset($_POST['new_title']) ? $_POST['new_title'] : '';
    $slug = isset($_POST['new_slug']) ? $_POST['new_slug'] : null;
    wp_die(get_sample_permalink_html($post_id, $title, $slug));
}

WordPress Version: 5.6

/**
 * Ajax handler to retrieve a sample permalink.
 *
 * @since 3.1.0
 */
function wp_ajax_sample_permalink()
{
    check_ajax_referer('samplepermalink', 'samplepermalinknonce');
    $post_id = isset($_POST['post_id']) ? (int) $_POST['post_id'] : 0;
    $title = isset($_POST['new_title']) ? $_POST['new_title'] : '';
    $slug = isset($_POST['new_slug']) ? $_POST['new_slug'] : null;
    wp_die(get_sample_permalink_html($post_id, $title, $slug));
}

WordPress Version: 4.0

/**
 * Ajax handler to retrieve a sample permalink.
 *
 * @since 3.1.0
 */
function wp_ajax_sample_permalink()
{
    check_ajax_referer('samplepermalink', 'samplepermalinknonce');
    $post_id = isset($_POST['post_id']) ? intval($_POST['post_id']) : 0;
    $title = isset($_POST['new_title']) ? $_POST['new_title'] : '';
    $slug = isset($_POST['new_slug']) ? $_POST['new_slug'] : null;
    wp_die(get_sample_permalink_html($post_id, $title, $slug));
}

WordPress Version: 3.7

function wp_ajax_sample_permalink()
{
    check_ajax_referer('samplepermalink', 'samplepermalinknonce');
    $post_id = isset($_POST['post_id']) ? intval($_POST['post_id']) : 0;
    $title = isset($_POST['new_title']) ? $_POST['new_title'] : '';
    $slug = isset($_POST['new_slug']) ? $_POST['new_slug'] : null;
    wp_die(get_sample_permalink_html($post_id, $title, $slug));
}