$categories_struct = array
();
$cats =
get_categories( array
( 'get' => 'all'
) );
if ( $cats ) { foreach ( $cats as $cat ) { $struct = array
();
$struct['categoryId'
] =
$cat->term_id;
$struct['parentId'
] =
$cat->parent;
$struct['description'
] =
$cat->name;
$struct['categoryDescription'
] =
$cat->description;
$struct['categoryName'
] =
$cat->name;
$struct['htmlUrl'
] =
esc_html( get_category_link( $cat->term_id
) );
$struct['rssUrl'
] =
esc_html( get_category_feed_link( $cat->term_id, 'rss2'
) );
$categories_struct[] =
$struct;
} } return $categories_struct;
} /**
* Uploads a file, following your settings.
*
* Adapted from a patch by Johann Richard.
*
* @link http://mycvs.org/archives/2004/06/30/file-upload-to-wordpress-in-ecto/
*
* @since 1.5.0
*
* @global wpdb $wpdb WordPress database abstraction object.
*
* @param array $args {
* Method arguments. Note: arguments must be ordered as documented.
*
* @type int $0 Blog ID (unused).
* @type string $1 Username.
* @type string $2 Password.
* @type array $3 Data.
* }
* @return array|IXR_Error
*/