Changeset 44636 for trunk/src/wp-includes/general-template.php
- Timestamp:
- 01/17/2019 07:20:16 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/general-template.php
r44635 r44636 1694 1694 * @param string $before Content to prepend to the description. 1695 1695 * @param string $after Content to append to the description. 1696 */ 1697 return apply_filters( 'get_archives_link', $link_html, $url, $text, $format, $before, $after ); 1696 * @param bool $selected True if the current page is the selected archive 1697 */ 1698 return apply_filters( 'get_archives_link', $link_html, $url, $text, $format, $before, $after, $selected ); 1698 1699 } 1699 1700 … … 1821 1822 $r['after'] = ' (' . $result->posts . ')' . $after; 1822 1823 } 1823 $output .= get_archives_link( $url, $text, $r['format'], $r['before'], $r['after'] ); 1824 $selected = is_archive() && ( string ) $r[ 'year' ] === $result->year 1825 && ( string ) $r[ 'monthnum' ] === $result->month; 1826 $output .= get_archives_link( $url, $text, $r['format'], $r['before'], $r['after'], $selected ); 1824 1827 } 1825 1828 } … … 1843 1846 $r['after'] = ' (' . $result->posts . ')' . $after; 1844 1847 } 1845 $output .= get_archives_link( $url, $text, $r['format'], $r['before'], $r['after'] ); 1848 $selected = is_archive() && ( string ) $r[ 'year' ] === $result->year; 1849 $output .= get_archives_link( $url, $text, $r['format'], $r['before'], $r['after'], $selected ); 1846 1850 } 1847 1851 } … … 1866 1870 $r['after'] = ' (' . $result->posts . ')' . $after; 1867 1871 } 1868 $output .= get_archives_link( $url, $text, $r['format'], $r['before'], $r['after'] ); 1872 $selected = is_archive() && ( string ) $r[ 'year' ] === $result->year 1873 && ( string ) $r[ 'monthnum' ] === $result->month 1874 && ( string ) $r[ 'day' ] === $result->dayofmonth; 1875 $output .= get_archives_link( $url, $text, $r['format'], $r['before'], $r['after'], $selected ); 1869 1876 } 1870 1877 } … … 1902 1909 $r['after'] = ' (' . $result->posts . ')' . $after; 1903 1910 } 1904 $output .= get_archives_link( $url, $text, $r['format'], $r['before'], $r['after'] ); 1911 $selected = is_archive() && ( string ) $r[ 'year' ] === $result->yr 1912 && ( string ) $r[ 'week' ] === $result->week; 1913 $output .= get_archives_link( $url, $text, $r['format'], $r['before'], $r['after'], $selected ); 1905 1914 } 1906 1915 } … … 1925 1934 $text = $result->ID; 1926 1935 } 1927 $output .= get_archives_link( $url, $text, $r['format'], $r['before'], $r['after'] ); 1936 $selected = $result->ID === get_the_ID(); 1937 $output .= get_archives_link( $url, $text, $r['format'], $r['before'], $r['after'], $selected ); 1928 1938 } 1929 1939 }
Note: See TracChangeset
for help on using the changeset viewer.