Changeset 62838 for trunk/src/wp-admin/includes/class-wp-list-table.php
- Timestamp:
- 07/23/2026 08:59:29 PM (2 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-list-table.php
r62756 r62838 1769 1769 1770 1770 /** 1771 * Returns a clean, human-readable label for the primary column's row header. 1772 * 1773 * Used as the `aria-label` attribute value on the `<th scope="row">` element, 1774 * giving screen readers a concise cell name instead of computing it from 1775 * the full cell content (which may include row action links, excerpts, etc.). 1776 * 1777 * Subclasses should override this method to return the item's primary 1778 * identifier (e.g. post title, plugin name, username). Return an empty string 1779 * to omit the attribute. 1780 * 1781 * @since 6.9.0 1782 * 1783 * @param object|array $item The current item. 1784 * @return string The aria-label value, or an empty string. 1785 */ 1786 protected function get_primary_column_aria_label( $item ) { 1787 return ''; 1788 } 1789 1790 /** 1771 1791 * Generates the columns for a single row of the table. 1772 1792 * … … 1797 1817 1798 1818 if ( 'cb' === $column_name ) { 1799 echo '<t h scope="row"class="check-column">';1819 echo '<td class="check-column">'; 1800 1820 echo $this->column_cb( $item ); 1801 echo '</t h>';1821 echo '</td>'; 1802 1822 } elseif ( method_exists( $this, '_column_' . $column_name ) ) { 1803 1823 echo call_user_func( … … 1808 1828 $primary 1809 1829 ); 1810 } elseif ( method_exists( $this, 'column_' . $column_name ) ) { 1811 echo "<td $attributes>"; 1812 echo call_user_func( array( $this, 'column_' . $column_name ), $item ); 1830 } else { 1831 $is_primary = ( $primary === $column_name ); 1832 $tag = $is_primary ? 'th' : 'td'; 1833 $scope = $is_primary ? ' scope="row"' : ''; 1834 1835 $aria_label = ''; 1836 if ( $is_primary ) { 1837 $label = $this->get_primary_column_aria_label( $item ); 1838 if ( '' !== $label ) { 1839 $aria_label = ' aria-label="' . esc_attr( $label ) . '"'; 1840 } 1841 } 1842 1843 echo "<$tag $attributes$scope$aria_label>"; 1844 1845 if ( method_exists( $this, 'column_' . $column_name ) ) { 1846 echo call_user_func( array( $this, 'column_' . $column_name ), $item ); 1847 } else { 1848 echo $this->column_default( $item, $column_name ); 1849 } 1850 1813 1851 echo $this->handle_row_actions( $item, $column_name, $primary ); 1814 echo '</td>'; 1815 } else { 1816 echo "<td $attributes>"; 1817 echo $this->column_default( $item, $column_name ); 1818 echo $this->handle_row_actions( $item, $column_name, $primary ); 1819 echo '</td>'; 1852 echo "</$tag>"; 1820 1853 } 1821 1854 }
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)