Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




get_cat_name [ WordPress Function ]

get_cat_name ( $cat_id )
Parameters:
  • (int) $cat_id Category ID
Returns:
  • (string) Category name, or an empty string if category doesn't exist.
Defined at:



Retrieve the name of a category from its ID.

Source


<?php
function get_cat_name$cat_id ) {
    
$cat_id = (int) $cat_id;
    
$category = &get_category$cat_id );
    if ( ! 
$category || is_wp_error$category ) )
        return 
'';
    return 
$category->name;
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics