/**
* Retrieves a category object by category slug.
*
* @since 2.3.0
*
* @param string $slug The category slug.
* @return object|false Category data object on success, false if not found.
*/
function get_category_by_slug( $slug ) { $category =
get_term_by( 'slug',
$slug, 'category'
);
if ( $category ) { _make_cat_compat( $category );
} return $category;
}/**
* Retrieves the ID of a category from its name.
*
* @since 1.0.0
*
* @param string $cat_name Category name.
* @return int Category ID on success, 0 if the category doesn't exist.
*/