# This patch file was generated by NetBeans IDE
# Following Index: paths are relative to: /var/www/GSoC/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.getTerms' => 'this:wp_getTerms', |
67 | 68 | |
68 | 69 | // Blogger API |
69 | 70 | 'blogger.getUsersBlogs' => 'this:blogger_getUsersBlogs', |
… |
… |
|
1702 | 1703 | return $formats; |
1703 | 1704 | } |
1704 | 1705 | |
| 1706 | /** |
| 1707 | * Retrieve terms |
| 1708 | * |
| 1709 | * @uses get_terms() |
| 1710 | * @param array $args Method parameters. Contains: |
| 1711 | * - int $blog_id |
| 1712 | * - string $username |
| 1713 | * - string $password |
| 1714 | * - array $content_struct contains: |
| 1715 | * - 'taxonomy' |
| 1716 | * @return array terms |
| 1717 | */ |
| 1718 | function wp_getTerms($args) { |
| 1719 | |
| 1720 | $this->escape( $args ); |
| 1721 | |
| 1722 | $blog_ID = (int) $args[0]; |
| 1723 | $username = $args[1]; |
| 1724 | $password = $args[2]; |
| 1725 | $content_struct = $args[3]; |
| 1726 | |
| 1727 | if ( ! $user = $this->login( $username, $password ) ) |
| 1728 | return $this->error; |
| 1729 | |
| 1730 | if ( ! taxonomy_exists( $content_struct['taxonomy'] ) ) |
| 1731 | return new IXR_Error( 403, __( 'Invalid taxonomy' ) ); |
| 1732 | |
| 1733 | $taxonomy = get_taxonomy( $content_struct['taxonomy'] ); |
| 1734 | |
| 1735 | if( ! current_user_can( $taxonomy->cap->assign_terms ) ) |
| 1736 | return new IXR_Error( 401, __( 'You are not allowed to assign terms in this taxonomy' ) ); |
| 1737 | |
| 1738 | $terms = get_terms( $content_struct['taxonomy'] , array('get' => 'all') ); |
| 1739 | |
| 1740 | if ( is_wp_error( $terms ) ) |
| 1741 | return new IXR_Error(500, $term->get_error_message()); |
| 1742 | |
| 1743 | if ( ! $terms ) |
| 1744 | return new IXR_Error(500, __('The term ID does not exists')); |
| 1745 | |
| 1746 | return $terms; |
| 1747 | |
| 1748 | } |
| 1749 | |
1705 | 1750 | /* Blogger API functions. |
1706 | 1751 | * specs on http://plant.blogger.com/api and http://groups.yahoo.com/group/bloggerDev/ |
1707 | 1752 | */ |