Static Public Member Functions | Static Protected Attributes

Tags Class Reference

Inheritance diagram for Tags:
Collaboration diagram for Tags:

List of all members.

Static Public Member Functions

static get_one ($tag)
static get_by_text ($tag)
static get_by_slug ($tag)
static get_by_id ($tag)
static vocabulary ()
static get_by_frequency ($limit=null, $post_type=null)
static object_type ()
static save_associations ($terms, $object_id, $object_type= 'post')
static parse_url_tags ($tags, $objectify=false)
static search ($q)

Static Protected Attributes

static $vocabulary = 'tags'
static $object_type = 'post'

Detailed Description

Habari Tags Class

Definition at line 13 of file tags.php.


Member Function Documentation

static Tags::get_by_frequency ( limit = null,
post_type = null 
) [static]

Returns a list of terms from this vocabulary ordered by frequency of use on the post type specified

Parameters:
int $limit If supplied, limits the results to the specified number
mixed $post_type If a name or id of a post type is supplied, limits the results to the terms applying to that type
Returns:
Tags A Tags instance containing the terms, each having an additional property of "count" that tells how many times the term was used

Definition at line 83 of file tags.php.

static Tags::get_by_id ( tag  )  [static]

Returns a Tag object based on a supplied ID

Parameters:
Integer $tag The ID of the tag to retrieve
Returns:
Tag A Tag object

Reimplemented from Vocabulary.

Definition at line 61 of file tags.php.

Referenced by AdminTagsHandler::ajax_tags().

static Tags::get_by_slug ( tag  )  [static]

Return a tag based on a tag's text

Parameters:
string $tag The tag slug
Returns:
Tag A Tag object

Definition at line 50 of file tags.php.

Referenced by WPImport::action_auth_ajax_wp_import_posts().

static Tags::get_by_text ( tag  )  [static]

Return a tag based on a tag's text

Parameters:
string $tag The tag's text (not slug)
Returns:
Tag A Tag object

Definition at line 39 of file tags.php.

static Tags::get_one ( tag  )  [static]

Return a tag based on an id, tag text or slug

Parameters:
string|integer $tag A tag's text, slug, or id
Returns:
Tag The tag object

Definition at line 24 of file tags.php.

Referenced by get_by_id(), get_by_slug(), get_by_text(), and parse_url_tags().

static Tags::object_type (  )  [static]

Returns the default type Tags uses

Returns:
String The default type name

Definition at line 122 of file tags.php.

static Tags::parse_url_tags ( tags,
objectify = false 
) [static]

Parse tag parameters from a URL string

Parameters:
String $tags The URL parameter string
Returns:
Array. Associative array of included and excluded tags

Definition at line 151 of file tags.php.

Referenced by Theme::act_display(), and Theme::act_display_tag().

static Tags::save_associations ( terms,
object_id,
object_type = 'post' 
) [static]

Save the tags associated to this object into the terms and object_terms tables

Parameters:
Array $tags strings. The tag names to associate to the object
Integer $object_id. The id of the object being tagged
String $object_type. The name of the type of the object being tagged. Defaults to post
Returns:
boolean. Whether the associating succeeded or not. true

Definition at line 136 of file tags.php.

Referenced by Post::delete().

static Tags::search ( q  )  [static]

Return a terms that match a substring criteria

Parameters:
string $q Criteria of a term to match
Returns:
Terms The matching terms

Definition at line 174 of file tags.php.

Referenced by AjaxHandler::__static().

static Tags::vocabulary (  )  [static]

The documentation for this class was generated from the following file: