| | 828 | * Get list of all tags |
| | 829 | * |
| | 830 | * @since 2.7 |
| | 831 | * |
| | 832 | * @param array $args Method parameters. |
| | 833 | * @return array |
| | 834 | */ |
| | 835 | function wp_getTags( $args ) { |
| | 836 | $this->escape( $args ); |
| | 837 | |
| | 838 | $blog_id = (int) $args[0]; |
| | 839 | $username = $args[1]; |
| | 840 | $password = $args[2]; |
| | 841 | |
| | 842 | if( !$this->login_pass_ok( $username, $password ) ) { |
| | 843 | return $this->error; |
| | 844 | } |
| | 845 | |
| | 846 | set_current_user( 0, $username ); |
| | 847 | if( !current_user_can( 'edit_posts' ) ) { |
| | 848 | return new IXR_Error( 401, __( 'Sorry, you must be able to edit posts on this blog in order to view tags.' ) ); |
| | 849 | } |
| | 850 | |
| | 851 | do_action( 'xmlrpc_call', 'wp.getKeywords' ); |
| | 852 | |
| | 853 | $tags = array( ); |
| | 854 | |
| | 855 | if( $all_tags = get_tags( ) ) { |
| | 856 | foreach( (array) $all_tags as $tag ) { |
| | 857 | $struct['tag_id'] = $tag->term_id; |
| | 858 | $struct['name'] = $tag->name; |
| | 859 | $struct['count'] = $tag->count; |
| | 860 | $struct['slug'] = $tag->slug; |
| | 861 | $struct['html_url'] = wp_specialchars( get_tag_link( $tag->term_id ) ); |
| | 862 | $struct['rss_url'] = wp_specialchars( get_tag_feed_link( $tag->term_id ) ); |
| | 863 | |
| | 864 | $tags[] = $struct; |
| | 865 | } |
| | 866 | } |
| | 867 | |
| | 868 | return $tags; |
| | 869 | } |
| | 870 | |
| | 871 | /** |