WordPress.org

Make WordPress Core

Ticket #12526: clipboard.patch

File clipboard.patch, 2.9 KB (added by hakre, 9 years ago)

Argument Order and Optionality

  • wp-includes/category-template.php

    ### Eclipse Workspace Patch 1.0
    #P wordpress
     
    248248 *
    249249 * @since 1.2.0
    250250 *
    251  * @uses has_term()
    252  *
    253251 * @param int|string|array $category Category ID, name or slug, or array of said.
    254252 * @param int|object $_post Optional. Post to check instead of the current post. (since 2.7.0)
    255253 * @return bool True if the current post is in any of the given categories.
    256254 */
    257255function in_category( $category, $post = null ) {
    258         return has_term( $category, 'category', $post );
     256        return has_term( 'category', $category, $post );
    259257}
    260258
    261259/**
     
    962960 *
    963961 * @since 3.1.0
    964962 *
    965  * @uses has_term()
    966  *
    967963 * @param string|int|array $tag Optional. The category name/term_id/slug or array of them to check for.
    968964 * @param int|object $post Optional. Post to check instead of the current post.
    969965 * @return bool True if the current post has any of the given categories (or any category, if no category specified).
    970966 */
    971967function has_category( $category = '', $post = null ) {
    972         return has_term( $category, 'category', $post );
     968        return has_term( 'category', $category, $post );
    973969}
    974970
    975971/**
     
    985981 *
    986982 * @since 2.6.0
    987983 *
    988  * @uses has_term()
    989  *
    990984 * @param string|int|array $tag Optional. The tag name/term_id/slug or array of them to check for.
    991985 * @param int|object $post Optional. Post to check instead of the current post. (since 2.7.0)
    992986 * @return bool True if the current post has any of the given tags (or any tag, if no tag specified).
    993987 */
    994988function has_tag( $tag = '', $post = null ) {
    995         return has_term( $tag, 'post_tag', $post );
     989        return has_term( 'post_tag', $tag, $post );
    996990}
    997991
    998992/**
    999  * Check if the current post has any of given terms.
     993 * Check if the current post has one of given term(s).
    1000994 *
    1001  * The given terms are checked against the post's terms' term_ids, names and slugs.
    1002  * Terms given as integers will only be checked against the post's terms' term_ids.
    1003  * If no terms are given, determines if post has any terms.
    1004  *
     995 * this function wrap is_object_in_term() and maps the arguments
     996 * accordingly. {@see is_object_in_term} for parameter details.
     997 *
    1005998 * @since 3.1.0
    1006999 *
    1007  * @uses is_object_in_term()
    1008  *
    1009  * @param string|int|array $term Optional. The term name/term_id/slug or array of them to check for.
     1000 * @param string $taxonomy
     1001 * @param string|int|array $term The term name/term_id/slug or array of them to check for.
    10101002 * @param int|post object Optional.  Post to check instead of the current post.
    1011  * @since 2.7.0
    10121003 * @return bool True if the current post has any of the given tags (or any tag, if no tag specified).
    10131004 */
    1014 function has_term( $term = '', $taxonomy = '', $post = null ) {
    1015         $post = get_post($post);
     1005function has_term( $taxonomy, $term, $post = null ) {
     1006        $post = get_post( $post );
    10161007
    10171008        if ( !$post )
    10181009                return false;