~canonical-sysadmins/wordpress/4.2.4

« back to all changes in this revision

Viewing changes to wp-admin/includes/taxonomy.php

  • Committer: Jacek Nykis
  • Date: 2015-02-25 10:24:27 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: jacek.nykis@canonical.com-20150225102427-qcgi5in6sp035mov
MergedĀ upstreamĀ versionĀ 4.1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
//
12
12
 
13
13
/**
14
 
 * {@internal Missing Short Description}}
 
14
 * Check whether a category exists.
15
15
 *
16
16
 * @since 2.0.0
17
17
 *
18
 
 * @param int|string $cat_name
19
 
 * @return int
 
18
 * @see term_exists()
 
19
 *
 
20
 * @param int|string $cat_name Category name.
 
21
 * @param int        $parent   Optional. ID of parent term.
 
22
 * @return mixed
20
23
 */
21
 
function category_exists($cat_name, $parent = 0) {
 
24
function category_exists( $cat_name, $parent = null ) {
22
25
        $id = term_exists($cat_name, 'category', $parent);
23
26
        if ( is_array($id) )
24
27
                $id = $id['term_id'];