Make WordPress Core


Ignore:
Timestamp:
02/01/2021 02:11:57 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Posts, Post Types: Introduce "Filter by date" and "Filter by category" as post type and taxonomy labels, respectively.

This provides a more consistent location for these strings and allows for reusing them in other places without hardcoding them in the markup.

Props nicolalaserra, audrasjb, johnjamesjacoby, SergeyBiryukov.
Fixes #42421.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-list-table.php

    r49944 r50120  
    634634        $m = isset( $_GET['m'] ) ? (int) $_GET['m'] : 0;
    635635        ?>
    636         <label for="filter-by-date" class="screen-reader-text"><?php _e( 'Filter by date' ); ?></label>
     636        <label for="filter-by-date" class="screen-reader-text"><?php echo get_post_type_object( $post_type )->labels->filter_by_date; ?></label>
    637637        <select name="m" id="filter-by-date">
    638638            <option<?php selected( $m, 0 ); ?> value="0"><?php _e( 'All dates' ); ?></option>
Note: See TracChangeset for help on using the changeset viewer.