get_delete_post_link
Filter HookDescription
Filters the post delete link.Hook Information
File Location |
wp-includes/link-template.php
View on GitHub
|
Hook Type | Filter |
Line Number | 1591 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$link
|
The delete link. |
int
|
$post_id
|
Post ID. |
bool
|
$force_delete
|
Whether to bypass the Trash and force deletion. Default false. |
Usage Examples
Basic Usage
<?php
// Hook into get_delete_post_link
add_filter('get_delete_post_link', 'my_custom_filter', 10, 3);
function my_custom_filter($link, $post_id, $force_delete) {
// Your custom filtering logic here
return $link;
}
Source Code Context
wp-includes/link-template.php:1591
- How this hook is used in WordPress core
<?php
1586 *
1587 * @param string $link The delete link.
1588 * @param int $post_id Post ID.
1589 * @param bool $force_delete Whether to bypass the Trash and force deletion. Default false.
1590 */
1591 return apply_filters( 'get_delete_post_link', wp_nonce_url( $delete_link, "$action-post_{$post->ID}" ), $post->ID, $force_delete );
1592 }
1593
1594 /**
1595 * Retrieves the edit comment link.
1596 *
PHP Documentation
<?php
/**
* 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.
*/
Quick Info
- Hook Type: Filter
- Parameters: 3
- File: wp-includes/link-template.php
Related Hooks
Related hooks will be displayed here in future updates.