Docs: Document that `get_category_by_slug()` returns `false` if the category doesn't exist.
Props stevenlinx. Fixes #50277. Built from https://develop.svn.wordpress.org/trunk@47863 git-svn-id: http://core.svn.wordpress.org/trunk@47639 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
8924832842
commit
bc18c233d6
|
@ -175,10 +175,11 @@ function get_category_by_path( $category_path, $full_match = true, $output = OBJ
|
||||||
* @since 2.3.0
|
* @since 2.3.0
|
||||||
*
|
*
|
||||||
* @param string $slug The category slug.
|
* @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 ) {
|
function get_category_by_slug( $slug ) {
|
||||||
$category = get_term_by( 'slug', $slug, 'category' );
|
$category = get_term_by( 'slug', $slug, 'category' );
|
||||||
|
|
||||||
if ( $category ) {
|
if ( $category ) {
|
||||||
_make_cat_compat( $category );
|
_make_cat_compat( $category );
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.5-alpha-47862';
|
$wp_version = '5.5-alpha-47863';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue