wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes
get_the_post_type_description › WordPress Function
Depuis4.9.0
Dépréciéen/a
› get_the_post_type_description ( Pas de paramètres )
Retourne: |
|
Défini(e) dans: |
|
Codex: |
Retrieves the description for a post type archive.
Fonctions en relation: get_the_author_description, get_the_archive_description, get_the_post_navigation, get_file_description, get_the_posts_pagination
Source
function get_the_post_type_description() { $post_type = get_query_var( 'post_type' ); if ( is_array( $post_type ) ) { $post_type = reset( $post_type ); } $post_type_obj = get_post_type_object( $post_type ); // Check if a description is set. if ( isset( $post_type_obj->description ) ) { $description = $post_type_obj->description; } else { $description = ''; } /** * Filters the description for a post type archive. * * @since 4.9.0 * * @param string $description The post type description. * @param WP_Post_Type $post_type_obj The post type object. */ return apply_filters( 'get_the_post_type_description', $description, $post_type_obj ); }