Package | com.absentdesign.core.webapis.wordpress.methodgroups |
Class | public class Categories |
Inheritance | Categories ![]() ![]() ![]() |
Method | Defined by | ||
---|---|---|---|
Categories(service:WPService)
| Categories | ||
deleteCategory(categoryId:int):void
Wrapper for wp.deleteCategory - delete a Category
Will dispatch a ServiceEvent of type WPServiceEvent.DELETE_CATEGORY with a struct as the WPServiceEvent.data once loaded | Categories | ||
getCategories():void
Wrapper for wp.getCategories - get an array of all categories
Will dispatch a ServiceEvent of type WPServiceEvent.GET_CATEGORIES with an Array of categories as the WPServiceEvent.data once loaded | Categories | ||
getPostCategories(postId:uint):void
Wrapper for mt.getPostCategories - get an array of categories for a specific post
Will dispatch a ServiceEvent of type WPServiceEvent.GET_POST_CATEGORIES with an Array of Categories as the WPServiceEvent.data once loaded | Categories | ||
![]() |
load(request:ServiceRequest):void
| MethodGroup | |
![]() |
loadRequest(request:WPServiceRequest, requestFunction:Function, ... args):void
Load a WPServiceRequest
Automatically calls service.connect() and delays the request until the service is connected if the WPService does not return a valid blogId | WPMethodGroup | |
newCategory(category:Category):void
Wrapper for wp.newCategory - add a new Category
Will dispatch a ServiceEvent of type WPServiceEvent.NEW_CATEGORY with a struct as the WPServiceEvent.data once loaded | Categories | ||
setPostCategories(postId:uint, categories:Array):void
Wrapper for mt.setPostCategories - set the categories for a specific post
Will dispatch a ServiceEvent of type WPServiceEvent.SET_POST_CATEGORIES with a struct of Categories as the WPServiceEvent.data once loaded There appears to be an issue where the XML-RPC interface will occasionally return different data to the HTML interface when this method is used - if you set the categories on a post, the HTML interface will return the old category set until the user has logged in and clicked "update post" in the admin - the XML-RPC interface (and hence flash) will return the correct category set however. | Categories | ||
suggestCategories(category:String, maxResults:int = 5):void
Wrapper for wp.suggestCategories - get an array of categories that start with a given string
Will dispatch a ServiceEvent of type WPServiceEvent.SUGGEST_CATEGORIES with an Array of categories as the WPServiceEvent.data once loaded | Categories |
Categories | () | constructor |
deleteCategory | () | method |
public function deleteCategory(categoryId:int):void
Wrapper for wp.deleteCategory - delete a Category
Will dispatch a ServiceEvent of type WPServiceEvent.DELETE_CATEGORY with a struct as the WPServiceEvent.data once loaded
ParameterscategoryId:int — the id of the Category to delete
|
getCategories | () | method |
public function getCategories():void
Wrapper for wp.getCategories - get an array of all categories
Will dispatch a ServiceEvent of type WPServiceEvent.GET_CATEGORIES with an Array of categories as the WPServiceEvent.data once loaded
getPostCategories | () | method |
public function getPostCategories(postId:uint):void
Wrapper for mt.getPostCategories - get an array of categories for a specific post
Will dispatch a ServiceEvent of type WPServiceEvent.GET_POST_CATEGORIES with an Array of Categories as the WPServiceEvent.data once loaded
ParameterspostId:uint — the id of the post to get categories for
|
newCategory | () | method |
public function newCategory(category:Category):void
Wrapper for wp.newCategory - add a new Category
Will dispatch a ServiceEvent of type WPServiceEvent.NEW_CATEGORY with a struct as the WPServiceEvent.data once loaded
Parameterscategory:Category — the new Category to add
|
setPostCategories | () | method |
public function setPostCategories(postId:uint, categories:Array):void
Wrapper for mt.setPostCategories - set the categories for a specific post
Will dispatch a ServiceEvent of type WPServiceEvent.SET_POST_CATEGORIES with a struct of Categories as the WPServiceEvent.data once loaded
There appears to be an issue where the XML-RPC interface will occasionally return different data to the HTML interface when this method is used - if you set the categories on a post, the HTML interface will return the old category set until the user has logged in and clicked "update post" in the admin - the XML-RPC interface (and hence flash) will return the correct category set however.
ParameterspostId:uint — the id of the post to set categories on
|
|
categories:Array — an array of categories containing int categoryId and boolean isPrimary. Using isPrimary to set the primary category is optional—in the absence of this flag, the first element in the array will be assigned the primary category for the post.
|
suggestCategories | () | method |
public function suggestCategories(category:String, maxResults:int = 5):void
Wrapper for wp.suggestCategories - get an array of categories that start with a given string
Will dispatch a ServiceEvent of type WPServiceEvent.SUGGEST_CATEGORIES with an Array of categories as the WPServiceEvent.data once loaded
Parameterscategory:String — the string to use
|
|
maxResults:int (default = 5 )
|