function &get_tag( $tag, $output = OBJECT, $filter = 'raw' ) {}

Retrieve post tag by tag ID or tag object.
If you pass the $tag parameter an object, which is assumed to be the tag row object retrieved the database. It will cache the tag data.


  • int|object $tag
  • string $output: Optional. Constant OBJECT, ARRAY_A, or ARRAY_N
  • string $filter: Optional. Default is raw or no WordPress defined filter will applied.

Return values

returns:Return type based on $output value.

Source code

function &get_tag( $tag, $output = OBJECT, $filter = 'raw' ) {

	return get_term( $tag, 'post_tag', $output, $filter );



No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: