Changeset 44636
- Timestamp:
- 01/17/2019 07:20:16 AM (6 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 2 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 } -
trunk/src/wp-includes/post.php
r44587 r44636 508 508 * 509 509 * @since 2.9.0 510 * @access private 510 511 * 511 512 * @param string $path Full path to the file. … … 914 915 * 915 916 * @since 4.9.6 917 * @access private 916 918 * 917 919 * @return array … … 2482 2484 * 2483 2485 * @since 3.9.0 2486 * @access private 2484 2487 * 2485 2488 * @param string $type Optional. Post type to retrieve count Default 'post'. … … 4904 4907 * 4905 4908 * @since 2.9.0 4909 * @access private 4906 4910 * 4907 4911 * @see _page_traverse_name()
Note: See TracChangeset
for help on using the changeset viewer.