# This patch file was generated by NetBeans IDE
# Following Index: paths are relative to: C:\xampp\htdocs\wordtrunk\wp-includes
# This patch can be applied using context Tools: Patch action on respective folder.
# It uses platform neutral UTF-8 encoding and \n newlines.
# Above lines and this line are ignored by the patching process.
|
|
|
|
| 64 | 64 | 'wp.getMediaItem' => 'this:wp_getMediaItem', |
| 65 | 65 | 'wp.getMediaLibrary' => 'this:wp_getMediaLibrary', |
| 66 | 66 | 'wp.getPostFormats' => 'this:wp_getPostFormats', |
| | 67 | 'wp.deletePost' => 'this:wp_deletePost', |
| 67 | 68 | |
| 68 | 69 | // Blogger API |
| 69 | 70 | 'blogger.getUsersBlogs' => 'this:blogger_getUsersBlogs', |
| … |
… |
|
| 1711 | 1712 | return $formats; |
| 1712 | 1713 | } |
| 1713 | 1714 | |
| | 1715 | /** |
| | 1716 | * Delete a post |
| | 1717 | * |
| | 1718 | * @uses wp_delete_post() |
| | 1719 | * @param array $args Method parameters. Contains: |
| | 1720 | * - int $post_id |
| | 1721 | * - string $username |
| | 1722 | * - string $password |
| | 1723 | * @return array post_ids |
| | 1724 | */ |
| | 1725 | function wp_deletePost( $args ) { |
| | 1726 | |
| | 1727 | $this->escape( $args ); |
| | 1728 | |
| | 1729 | $post_ID = (int)$args[0]; |
| | 1730 | $username = $args[1]; |
| | 1731 | $password = $args[2]; |
| | 1732 | |
| | 1733 | if ( ! $user = $this->login( $username, $password ) ) |
| | 1734 | return $this->error; |
| | 1735 | |
| | 1736 | do_action('xmlrpc_call', 'wp.deletePost'); |
| | 1737 | |
| | 1738 | $post = wp_get_single_post( $post_ID, ARRAY_A ); |
| | 1739 | if ( empty( $post['ID'] ) ) |
| | 1740 | return new IXR_Error( 404, __( 'Invalid post ID.' ) ); |
| | 1741 | |
| | 1742 | $post_type = get_post_type_object( $post['post_type'] ); |
| | 1743 | if( ! current_user_can( $post_type->cap->delete_post, $post_ID ) ) |
| | 1744 | return new IXR_Error( 401, __( 'Sorry, you are not allowed to delete this post.' )); |
| | 1745 | |
| | 1746 | $result = wp_delete_post( $post_ID ); |
| | 1747 | |
| | 1748 | if ( !$result ) |
| | 1749 | return new IXR_Error(500, __('The post cannot be deleted.')); |
| | 1750 | |
| | 1751 | return true; |
| | 1752 | |
| | 1753 | } |
| | 1754 | |
| 1714 | 1755 | /* Blogger API functions. |
| 1715 | 1756 | * specs on http://plant.blogger.com/api and http://groups.yahoo.com/group/bloggerDev/ |
| 1716 | 1757 | */ |