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:
Sergey Biryukov 2020-05-29 10:00:32 +00:00
parent 7f73f1a1e4
commit 0133a78dec

View File

@ -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 );
}