wp-includes/link-template.php:1556Retrieves the delete posts link for post.
$postint|WP_Postoptional0$deprecatedstringoptional''$force_deletebooloptionalfalsestring|nullOne hook fires while get_delete_post_link() runs, in this order:
Filters the post delete link.
function get_delete_post_link( $post = 0, $deprecated = '', $force_delete = false ) { if ( ! empty( $deprecated ) ) { _deprecated_argument( __FUNCTION__, '3.0.0' ); } $post = get_post( $post ); if ( ! $post ) { return null; } $post_type_object = get_post_type_object( $post->post_type ); if ( ! $post_type_object ) { return null; } if ( ! current_user_can( 'delete_post', $post->ID ) ) { return null; } $action = ( $force_delete || ! EMPTY_TRASH_DAYS ) ? 'delete' : 'trash'; $delete_link = add_query_arg( 'action', $action, admin_url( sprintf( $post_type_object->_edit_link, $post->ID ) ) ); /** * Filters the post delete link. * * @since 2.9.0 * * @param string $link The delete link. * @param int $post_id Post ID. * @param bool $force_delete Whether to bypass the Trash and force deletion. Default false. */ return apply_filters( 'get_delete_post_link', wp_nonce_url( $delete_link, "$action-post_{$post->ID}" ), $post->ID, $force_delete );}Introduced in 2.9.0. One change between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
string|void to string|null.verified against sourcesrc/wp-includes/link-template.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.