WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/03/2010 02:58:59 AM (10 years ago)
Author:
nacin
Message:

Move some post and taxonomy functions from admin/includes to wp-includes in preparation for QuickPress template tag. Moves get_tags_to_edit, get_terms_to_edit, get_default_post_to_edit, media_buttons, _media_button, get_upload_iframe_src. Also introduce get_media_buttons as a wrapper for media_buttons. props jorbin, see #14966.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/taxonomy.php

    r15220 r15688  
    195195 * @since unknown
    196196 *
    197  * @param unknown_type $post_id
    198  * @return unknown
    199  */
    200 function get_tags_to_edit( $post_id, $taxonomy = 'post_tag' ) {
    201     return get_terms_to_edit( $post_id, $taxonomy);
    202 }
    203 
    204 /**
    205  * {@internal Missing Short Description}}
    206  *
    207  * @since unknown
    208  *
    209  * @param unknown_type $post_id
    210  * @return unknown
    211  */
    212 function get_terms_to_edit( $post_id, $taxonomy = 'post_tag' ) {
    213     $post_id = (int) $post_id;
    214     if ( !$post_id )
    215         return false;
    216 
    217     $tags = wp_get_post_terms($post_id, $taxonomy, array());
    218 
    219     if ( !$tags )
    220         return false;
    221 
    222     if ( is_wp_error($tags) )
    223         return $tags;
    224 
    225     foreach ( $tags as $tag )
    226         $tag_names[] = $tag->name;
    227     $tags_to_edit = join( ',', $tag_names );
    228     $tags_to_edit = esc_attr( $tags_to_edit );
    229     $tags_to_edit = apply_filters( 'terms_to_edit', $tags_to_edit, $taxonomy );
    230 
    231     return $tags_to_edit;
    232 }
    233 
    234 /**
    235  * {@internal Missing Short Description}}
    236  *
    237  * @since unknown
    238  *
    239197 * @param unknown_type $tag_name
    240198 * @return unknown
Note: See TracChangeset for help on using the changeset viewer.