term_description

Definition:
function term_description( $term = 0, $taxonomy = 'post_tag' ) {}

Retrieve term description.

Parameters

  • int $term: Optional. Term ID. Will use global term ID by default.
  • $taxonomy

Return values

returns:Term description, available.

Source code

function term_description( $term = 0, $taxonomy = 'post_tag' ) {

	if ( !$term && ( is_tax() || is_tag() || is_category() ) ) {

		$term = get_queried_object();

		$taxonomy = $term->taxonomy;

		$term = $term->term_id;

	}

	$description = get_term_field( 'description', $term, $taxonomy );

	return is_wp_error( $description ) ? '' : $description;

}

2939

taxonomy_exists

Definition:
function taxonomy_exists( $taxonomy ) {}

Checks that the taxonomy name exists.
Formerly is_taxonomy(), introduced in 2.3.0.

Parameters

  • string $taxonomy: Name of taxonomy object

Return values

returns:Whether the taxonomy exists.

Source code

function taxonomy_exists( $taxonomy ) {

	global $wp_taxonomies;



	return isset( $wp_taxonomies[$taxonomy] );

}

2937

tag_rows

Definition:
function tag_rows( $page = 1, $pagesize = 20, $searchterms = '', $taxonomy = 'post_tag' ) {}

Parameters

  • unknown_type $page
  • unknown_type $pagesize
  • unknown_type $searchterms
  • $taxonomy

Source code

function tag_rows( $page = 1, $pagesize = 20, $searchterms = '', $taxonomy = 'post_tag' ) {



	// Get a page worth of tags

	$start = ($page - 1) * $pagesize;



	$args = array('offset' => $start, 'number' => $pagesize, 'hide_empty' => 0);



	if ( !empty( $searchterms ) )

		$args['search'] = $searchterms;



	// convert it to table rows

	$out = '';

	$count = 0;

	if ( is_taxonomy_hierarchical($taxonomy) ) {

		// We'll need the full set of terms then.

		$args['number'] = $args['offset'] = 0;



		$terms = get_terms( $taxonomy, $args );

		if ( !empty( $searchterms ) ) // Ignore children on searches.

			$children = array();

		else

			$children = _get_term_hierarchy($taxonomy);



		// Some funky recursion to get the job done(Paging & parents mainly) is contained within, Skip it for non-hierarchical taxonomies for performance sake

		$out .= _term_rows($taxonomy, $terms, $children, $page, $pagesize, $count);

	} else {

		$terms = get_terms( $taxonomy, $args );

		foreach( $terms as $term )

			$out .= _tag_row( $term, 0, $taxonomy );

		$count = $pagesize; // Only displaying a single page.

	}



	echo $out;

	return $count;

}

2935

tag_exists

Definition:
function tag_exists($tag_name) {}

Parameters

  • unknown_type $tag_name

Source code

function tag_exists($tag_name) {

	return term_exists($tag_name, 'post_tag');

}

2933

tag_escape

Definition:
function tag_escape($tag_name) {}

Escape a HTML tag name.

Parameters

  • string $tag_name

Defined filters

  • tag_escape
    apply_filters('tag_escape', $safe_tag, $tag_name)

Source code

function tag_escape($tag_name) {

	$safe_tag = strtolower( preg_replace('/[^a-zA-Z0-9_:]/', '', $tag_name) );

	return apply_filters('tag_escape', $safe_tag, $tag_name);

}

2931