Pass parent to category_exists(). Props thetoine. fixes #11825
git-svn-id: http://svn.automattic.com/wordpress/trunk@12662 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
db46fa6e1d
commit
26ade42134
|
@ -48,7 +48,7 @@ function get_category_to_edit( $id ) {
|
||||||
* @return unknown
|
* @return unknown
|
||||||
*/
|
*/
|
||||||
function wp_create_category( $cat_name, $parent = 0 ) {
|
function wp_create_category( $cat_name, $parent = 0 ) {
|
||||||
if ( $id = category_exists($cat_name) )
|
if ( $id = category_exists($cat_name, $parent) )
|
||||||
return $id;
|
return $id;
|
||||||
|
|
||||||
return wp_insert_category( array('cat_name' => $cat_name, 'category_parent' => $parent) );
|
return wp_insert_category( array('cat_name' => $cat_name, 'category_parent' => $parent) );
|
||||||
|
|
Loading…
Reference in New Issue