mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Docs: Document that get_category_by_slug() returns false if the category doesn't exist.
Props stevenlinx. Fixes #50277. git-svn-id: https://develop.svn.wordpress.org/trunk@47863 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -175,10 +175,11 @@ function get_category_by_path( $category_path, $full_match = true, $output = OBJ
|
||||
* @since 2.3.0
|
||||
*
|
||||
* @param string $slug The category slug.
|
||||
* @return object Category data object
|
||||
* @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 );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user