Un motore di ricerca WordPress per sviluppatori e autori di temi



term_description ›

Da2.8.0
Deprecaton/a
term_description ( $term = 0, $deprecated = null )
Parametri: (2)
  • (int) $term Optional. Term ID. Will use global term ID by default.
    Richiesto: No
    Default:
  • (null) $deprecated Deprecated argument.
    Richiesto: No
    Default: null
Ritorna:
  • (string) Term description, available.
Definito a:
Codex:
ChangeLog:
  • 4.9.2

Retrieve term description.



Sorgenti

function term_description( $term = 0, $deprecated = null ) {
	if ( ! $term && ( is_tax() || is_tag() || is_category() ) ) {
		$term = get_queried_object();
		if ( $term ) {
			$term = $term->term_id;
		}
	}
	$description = get_term_field( 'description', $term );
	return is_wp_error( $description ) ? '' : $description;
}