ap_post_edit_link( mixed $_post )
Description #
Return edit link for question and answer.
Parameters #
- $_postmixed (Required) Post.
Source #
File: includes/functions.php
function ap_post_edit_link( $_post ) {
$_post = ap_get_post( $_post );
$nonce = wp_create_nonce( 'edit-post-' . $_post->ID );
$base_page = 'question' === $_post->post_type ? ap_get_link_to( 'ask' ) : ap_get_link_to( 'edit' );
$edit_link = add_query_arg(
array(
'id' => $_post->ID,
'__nonce' => $nonce,
),
$base_page
);
/**
* Allows filtering post edit link.
*
* @param string $edit_link Url to edit post.
* @since unknown
*/
return apply_filters( 'ap_post_edit_link', $edit_link );
}
Expand full source code Collapse full source code View on GitHub: includes/functions.php:305
Add your comment