wp_ajax_sample_permalink

Ajax handler to retrieve a sample permalink.

Description

wp_ajax_sample_permalink(); 

Usage

  1. if ( !function_exists( 'wp_ajax_sample_permalink' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/ajax-actions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wp_ajax_sample_permalink(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/includes/ajax-actions.php  
  1. function wp_ajax_sample_permalink() { 
  2. check_ajax_referer( 'samplepermalink', 'samplepermalinknonce' ); 
  3. $post_id = isset($_POST['post_id'])? intval($_POST['post_id']) : 0; 
  4. $title = isset($_POST['new_title'])? $_POST['new_title'] : ''; 
  5. $slug = isset($_POST['new_slug'])? $_POST['new_slug'] : null; 
  6. wp_die( get_sample_permalink_html( $post_id, $title, $slug ) );