wp_ajax_get_permalink() WordPress Function
The wp_ajax_get_permalink() function is used to retrieve the permalink for a given post ID. This is useful for creating links to specific posts in the WordPress admin area.
wp_ajax_get_permalink() #
Ajax handler to retrieve a permalink.
Source
File: wp-admin/includes/ajax-actions.php
function wp_ajax_get_permalink() {
check_ajax_referer( 'getpermalink', 'getpermalinknonce' );
$post_id = isset( $_POST['post_id'] ) ? (int) $_POST['post_id'] : 0;
wp_die( get_preview_post_link( $post_id ) );
}
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
| Version | Description |
|---|---|
| 3.1.0 | Introduced. |