wp_ajax_get_permalink

Ajax handler to retrieve a permalink.

Description

wp_ajax_get_permalink(); 

Usage

  1. if ( !function_exists( 'wp_ajax_get_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_get_permalink(); 
  7.  

Defined (1)

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

/wp-admin/includes/ajax-actions.php  
  1. function wp_ajax_get_permalink() { 
  2. check_ajax_referer( 'getpermalink', 'getpermalinknonce' ); 
  3. $post_id = isset($_POST['post_id'])? intval($_POST['post_id']) : 0; 
  4. wp_die( get_preview_post_link( $post_id ) );