wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi
wp_ajax_get_permalink › WordPress Function
Da3.1.0
Deprecaton/a
› wp_ajax_get_permalink ( Nessun parametro )
| Definito a: |
|
| Codex: |
Handles retrieving a permalink via AJAX.
Funzioni correlate: wp_ajax_sample_permalink, get_permalink, wp_ajax_delete_link, wp_ajax_delete_plugin, post_permalink
Sorgenti
function wp_ajax_get_permalink() {
check_ajax_referer( 'getpermalink', 'getpermalinknonce' );
$post_id = isset( $_POST['post_id'] ) ? (int) $_POST['post_id'] : 0;
if ( ! $post_id ) {
// Bypass call to get_preview_post_link() for unspecified post ID.
wp_die( '' );
}
if ( ! current_user_can( 'edit_post', $post_id ) ) {
wp_die( -1 );
}
wp_die( get_preview_post_link( $post_id ) );
}