関数 get_delete_post_link()
2015/01/14
関数 get_delete_post_link()
定義ファイル :/blog/wp-includes/link-template.php 3
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 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( 'delete_post', $post->ID ) ) return; $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 ) ) ); return apply_filters( 'get_delete_post_link', wp_nonce_url( $delete_link, "$action-post_{$post->ID}" ), $post->ID, $force_delete ); } |