WordPress.org

Make WordPress Core

Changeset 41221


Ignore:
Timestamp:
08/03/2017 04:12:25 PM (2 years ago)
Author:
johnbillion
Message:

General: Fix more instances of inconsistent parameters passed to various filters, plus fix some filter docs.

See #38462, #41017

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/edit-tags.php

    r40655 r41221  
    545545        __( 'Deleting a category does not delete the posts in that category. Instead, posts that were only assigned to the deleted category are set to the category %s.' ),
    546546        /** This filter is documented in wp-includes/category-template.php */
    547         '<strong>' . apply_filters( 'the_category', get_cat_name( get_option( 'default_category') ) ) . '</strong>'
     547        '<strong>' . apply_filters( 'the_category', get_cat_name( get_option( 'default_category') ), '', '' ) . '</strong>'
    548548    );
    549549    ?>
  • trunk/src/wp-admin/includes/class-walker-category-checklist.php

    r40348 r41221  
    9797                '<div class="' . $inner_class . '" data-term-id=' . $category->term_id .
    9898                ' tabindex="0" role="checkbox" aria-checked="' . $aria_checked . '">' .
    99                 esc_html( apply_filters( 'the_category', $category->name ) ) . '</div>';
     99                esc_html( apply_filters( 'the_category', $category->name, '', '' ) ) . '</div>';
    100100        } else {
    101101            /** This filter is documented in wp-includes/category-template.php */
     
    104104                checked( in_array( $category->term_id, $args['selected_cats'] ), true, false ) .
    105105                disabled( empty( $args['disabled'] ), false, false ) . ' /> ' .
    106                 esc_html( apply_filters( 'the_category', $category->name ) ) . '</label>';
     106                esc_html( apply_filters( 'the_category', $category->name, '', '' ) ) . '</label>';
    107107        }
    108108    }
  • trunk/src/wp-admin/includes/template.php

    r41184 r41221  
    215215                <?php
    216216                /** This filter is documented in wp-includes/category-template.php */
    217                 echo esc_html( apply_filters( 'the_category', $term->name ) );
     217                echo esc_html( apply_filters( 'the_category', $term->name, '', '' ) );
    218218                ?>
    219219            </label>
     
    256256
    257257        /** This filter is documented in wp-includes/category-template.php */
    258         $name = esc_html( apply_filters( 'the_category', $category->name ) );
     258        $name = esc_html( apply_filters( 'the_category', $category->name, '', '' ) );
    259259        $checked = in_array( $cat_id, $checked_categories ) ? ' checked="checked"' : '';
    260260        echo '<li id="link-category-', $cat_id, '"><label for="in-link-category-', $cat_id, '" class="selectit"><input value="', $cat_id, '" type="checkbox" name="link_category[]" id="in-link-category-', $cat_id, '"', $checked, '/> ', $name, "</label></li>";
  • trunk/src/wp-includes/category-template.php

    r41033 r41221  
    387387         * @see wp_dropdown_categories()
    388388         *
    389          * @param string $element Taxonomy element to list.
     389         * @param string       $element  Category name.
     390         * @param WP_Term|null $category The category object, or null if there's no corresponding category.
    390391         */
    391         $show_option_none = apply_filters( 'list_cats', $r['show_option_none'] );
     392        $show_option_none = apply_filters( 'list_cats', $r['show_option_none'], null );
    392393        $output .= "\t<option value='" . esc_attr( $option_none_value ) . "' selected='selected'>$show_option_none</option>\n";
    393394    }
     
    398399
    399400            /** This filter is documented in wp-includes/category-template.php */
    400             $show_option_all = apply_filters( 'list_cats', $r['show_option_all'] );
     401            $show_option_all = apply_filters( 'list_cats', $r['show_option_all'], null );
    401402            $selected = ( '0' === strval($r['selected']) ) ? " selected='selected'" : '';
    402403            $output .= "\t<option value='0'$selected>$show_option_all</option>\n";
     
    406407
    407408            /** This filter is documented in wp-includes/category-template.php */
    408             $show_option_none = apply_filters( 'list_cats', $r['show_option_none'] );
     409            $show_option_none = apply_filters( 'list_cats', $r['show_option_none'], null );
    409410            $selected = selected( $option_none_value, $r['selected'], false );
    410411            $output .= "\t<option value='" . esc_attr( $option_none_value ) . "'$selected>$show_option_none</option>\n";
Note: See TracChangeset for help on using the changeset viewer.