Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




get_delete_post_link [ WordPress Function ]

get_delete_post_link ( $id = 0, $deprecated = '', $force_delete = false )
Parameters:
  • (int) $id Optional. Post ID.
  • (string) $deprecated Not used.
  • (bool) $force_delete Whether to bypass trash and force deletion. Default is false.
Returns:
  • (string)
Defined at:



Retrieve delete posts link for post.

Can be used within the WordPress loop or outside of it, with any post type.

Source


<?php
function get_delete_post_link$id 0$deprecated ''$force_delete false ) {
    if ( ! empty( 
$deprecated ) )
        
_deprecated_argument__FUNCTION__'3.0' );

    if ( !
$post = &get_post$id ) )
        return;

    
$post_type_object get_post_type_object$post->post_type );
    if ( !
$post_type_object )
        return;

    if ( !
current_user_can$post_type_object->cap->delete_post$post->ID ) )
        return;

    
$action = ( $force_delete || !EMPTY_TRASH_DAYS ) ? 'delete' 'trash';

    
$delete_link add_query_arg'action'$actionadmin_urlsprintf$post_type_object->_edit_link$post->ID ) ) );

    return 
apply_filters'get_delete_post_link'wp_nonce_url$delete_link"$action-{$post->post_type}_{$post->ID}), $post->ID$force_delete );
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics