~canonical-sysadmins/wordpress/4.2.4

« back to all changes in this revision

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

  • Committer: Nick Moffitt
  • Date: 2015-01-15 11:05:37 UTC
  • mfrom: (1.1.1 wp4-upstream)
  • Revision ID: nick.moffitt@canonical.com-20150115110537-8bp1y42eyg0jsa7c
Tags: 4.1
MergeĀ upstreamĀ versionĀ 4.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 *
16
16
 * @since 2.0.0
17
17
 *
18
 
 * @param unknown_type $cat_name
19
 
 * @return unknown
 
18
 * @param int|string $cat_name
 
19
 * @return int
20
20
 */
21
21
function category_exists($cat_name, $parent = 0) {
22
22
        $id = term_exists($cat_name, 'category', $parent);
30
30
 *
31
31
 * @since 2.0.0
32
32
 *
33
 
 * @param unknown_type $id
34
 
 * @return unknown
 
33
 * @param int $id
 
34
 * @return object
35
35
 */
36
36
function get_category_to_edit( $id ) {
37
37
        $category = get_term( $id, 'category', OBJECT, 'edit' );
44
44
 *
45
45
 * @since 2.0.0
46
46
 *
47
 
 * @param unknown_type $cat_name
48
 
 * @param unknown_type $parent
49
 
 * @return unknown
 
47
 * @param int|string $cat_name
 
48
 * @param int        $parent
 
49
 * @return int|WP_Error
50
50
 */
51
51
function wp_create_category( $cat_name, $parent = 0 ) {
52
52
        if ( $id = category_exists($cat_name, $parent) )
190
190
 *
191
191
 * @since 2.3.0
192
192
 *
193
 
 * @param unknown_type $tag_name
194
 
 * @return unknown
 
193
 * @param int|string $tag_name
 
194
 * @return mixed
195
195
 */
196
196
function tag_exists($tag_name) {
197
197
        return term_exists($tag_name, 'post_tag');
202
202
 *
203
203
 * @since 2.3.0
204
204
 *
205
 
 * @param unknown_type $tag_name
206
 
 * @return unknown
 
205
 * @param int|string $tag_name
 
206
 * @return array|WP_Error
207
207
 */
208
208
function wp_create_tag($tag_name) {
209
209
        return wp_create_term( $tag_name, 'post_tag');
214
214
 *
215
215
 * @since 2.3.0
216
216
 *
217
 
 * @param unknown_type $post_id
218
 
 * @return unknown
 
217
 * @param int $post_id
 
218
 * @return string|bool|WP_Error
219
219
 */
220
220
function get_tags_to_edit( $post_id, $taxonomy = 'post_tag' ) {
221
221
        return get_terms_to_edit( $post_id, $taxonomy);
226
226
 *
227
227
 * @since 2.8.0
228
228
 *
229
 
 * @param unknown_type $post_id
230
 
 * @return unknown
 
229
 * @param int $post_id
 
230
 * @return string|bool|WP_Error
231
231
 */
232
232
function get_terms_to_edit( $post_id, $taxonomy = 'post_tag' ) {
233
233
        $post_id = (int) $post_id;
273
273
 *
274
274
 * @since 2.8.0
275
275
 *
276
 
 * @param unknown_type $tag_name
277
 
 * @return unknown
 
276
 * @param int|string $tag_name
 
277
 * @return array|WP_Error
278
278
 */
279
279
function wp_create_term($tag_name, $taxonomy = 'post_tag') {
280
280
        if ( $id = term_exists($tag_name, $taxonomy) )