NAME

WordPress::API::Category

CAVEATS

I am having problems with WordPress::XMLRPC::newCategory(), until I resolve that, this module is on hold.

How to id the category

To fetch a category and its attributes, you can provide an id or a categoryName. This is required before you call load() to fetch the data from the server.

$cat->categoryName('Super Stuff');
$cat->id(34);

METHODS

category setget methods

categoryId()

setget perl method argument is number

categoryName()

setget perl method argument is string

rssUrl()

setget perl method argument is url

parentId()

setget perl method argument is number

htmlUrl()

setget perl method argument is url

description()

setget perl method argument is string

object_type()

returns string 'Category'

load()

Optional argument is an id or categoryName string. Returns hashref, (but loads data into object)..

my $cat = new WordPress::API::Category({
   proxy => 'http://site.com/xmlrpc.php',
   username => 'jimmy',
   password => 'jimmyspass',
});

      $cat->id(5);
      $cat->load or die( $cat->errstr );
print $cat->rssUrl;

save()

Unfortunately wordpress' xmlrpc command can't edit categories.

MAKING NEW CATEGORY

You cannot save changes to a category, you can only view existing categories and create new ones. If you load() a category you cannot save() it. You can save() and then view its url, etc, though.

$cat->categoryName('House Inspections');
my $id = $cat->save;

# or
$cat->save;
my $id = $cat->id;

# now you can make a new post and set the parent to that category..
#
new WordPress::API::Post ....