General: Fix more instances of inconsistent parameters passed to various filters, plus fix some filter docs.
See #38462, #41017 git-svn-id: https://develop.svn.wordpress.org/trunk@41221 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
a3dec5dd51
commit
17fe24286d
@ -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>
|
||||
|
@ -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>';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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>";
|
||||
}
|
||||
|
@ -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";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user