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

See #38462, #41017

Built from https://develop.svn.wordpress.org/trunk@41221


git-svn-id: http://core.svn.wordpress.org/trunk@41061 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
John Blackbourn 2017-08-03 16:13:44 +00:00
parent 38f91be819
commit 4981452aba
5 changed files with 11 additions and 10 deletions

View File

@ -544,7 +544,7 @@ do_action( "{$taxonomy}_add_form", $taxonomy );
/* translators: %s: default category */
__( '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.' ),
/** This filter is documented in wp-includes/category-template.php */
'<strong>' . apply_filters( 'the_category', get_cat_name( get_option( 'default_category') ) ) . '</strong>'
'<strong>' . apply_filters( 'the_category', get_cat_name( get_option( 'default_category') ), '', '' ) . '</strong>'
);
?>
</p>

View File

@ -96,14 +96,14 @@ class Walker_Category_Checklist extends Walker {
$output .= "\n" . '<li' . $class . '>' .
'<div class="' . $inner_class . '" data-term-id=' . $category->term_id .
' tabindex="0" role="checkbox" aria-checked="' . $aria_checked . '">' .
esc_html( apply_filters( 'the_category', $category->name ) ) . '</div>';
esc_html( apply_filters( 'the_category', $category->name, '', '' ) ) . '</div>';
} else {
/** This filter is documented in wp-includes/category-template.php */
$output .= "\n<li id='{$taxonomy}-{$category->term_id}'$class>" .
'<label class="selectit"><input value="' . $category->term_id . '" type="checkbox" name="'.$name.'[]" id="in-'.$taxonomy.'-' . $category->term_id . '"' .
checked( in_array( $category->term_id, $args['selected_cats'] ), true, false ) .
disabled( empty( $args['disabled'] ), false, false ) . ' /> ' .
esc_html( apply_filters( 'the_category', $category->name ) ) . '</label>';
esc_html( apply_filters( 'the_category', $category->name, '', '' ) ) . '</label>';
}
}

View File

@ -214,7 +214,7 @@ function wp_popular_terms_checklist( $taxonomy, $default = 0, $number = 10, $ech
<input id="in-<?php echo $id; ?>" type="checkbox" <?php echo $checked; ?> value="<?php echo (int) $term->term_id; ?>" <?php disabled( ! current_user_can( $tax->cap->assign_terms ) ); ?> />
<?php
/** This filter is documented in wp-includes/category-template.php */
echo esc_html( apply_filters( 'the_category', $term->name ) );
echo esc_html( apply_filters( 'the_category', $term->name, '', '' ) );
?>
</label>
</li>
@ -255,7 +255,7 @@ function wp_link_category_checklist( $link_id = 0 ) {
$cat_id = $category->term_id;
/** This filter is documented in wp-includes/category-template.php */
$name = esc_html( apply_filters( 'the_category', $category->name ) );
$name = esc_html( apply_filters( 'the_category', $category->name, '', '' ) );
$checked = in_array( $cat_id, $checked_categories ) ? ' checked="checked"' : '';
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>";
}

View File

@ -386,9 +386,10 @@ function wp_dropdown_categories( $args = '' ) {
*
* @see wp_dropdown_categories()
*
* @param string $element Taxonomy element to list.
* @param string $element Category name.
* @param WP_Term|null $category The category object, or null if there's no corresponding category.
*/
$show_option_none = apply_filters( 'list_cats', $r['show_option_none'] );
$show_option_none = apply_filters( 'list_cats', $r['show_option_none'], null );
$output .= "\t<option value='" . esc_attr( $option_none_value ) . "' selected='selected'>$show_option_none</option>\n";
}
@ -397,7 +398,7 @@ function wp_dropdown_categories( $args = '' ) {
if ( $r['show_option_all'] ) {
/** This filter is documented in wp-includes/category-template.php */
$show_option_all = apply_filters( 'list_cats', $r['show_option_all'] );
$show_option_all = apply_filters( 'list_cats', $r['show_option_all'], null );
$selected = ( '0' === strval($r['selected']) ) ? " selected='selected'" : '';
$output .= "\t<option value='0'$selected>$show_option_all</option>\n";
}
@ -405,7 +406,7 @@ function wp_dropdown_categories( $args = '' ) {
if ( $r['show_option_none'] ) {
/** This filter is documented in wp-includes/category-template.php */
$show_option_none = apply_filters( 'list_cats', $r['show_option_none'] );
$show_option_none = apply_filters( 'list_cats', $r['show_option_none'], null );
$selected = selected( $option_none_value, $r['selected'], false );
$output .= "\t<option value='" . esc_attr( $option_none_value ) . "'$selected>$show_option_none</option>\n";
}

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.9-alpha-41220';
$wp_version = '4.9-alpha-41221';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.