Make WordPress Core


Ignore:
Timestamp:
05/25/2014 04:09:07 PM (12 years ago)
Author:
SergeyBiryukov
Message:

Replace $in_same_cat with $in_same_term in adjacent post functions for consistency.

props ixkaito.
fixes #28360.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/link-template.php

    r28327 r28574  
    17521752 * @return string
    17531753 */
    1754 function get_previous_post_link( $format = '« %link', $link = '%title', $in_same_cat = false, $excluded_terms = '', $taxonomy = 'category' ) {
    1755     return get_adjacent_post_link( $format, $link, $in_same_cat, $excluded_terms, true, $taxonomy );
     1754function get_previous_post_link( $format = '« %link', $link = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) {
     1755    return get_adjacent_post_link( $format, $link, $in_same_term, $excluded_terms, true, $taxonomy );
    17561756}
    17571757
     
    17681768 * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
    17691769 */
    1770 function previous_post_link( $format = '« %link', $link = '%title', $in_same_cat = false, $excluded_terms = '', $taxonomy = 'category' ) {
    1771     echo get_previous_post_link( $format, $link, $in_same_cat, $excluded_terms, $taxonomy );
     1770function previous_post_link( $format = '« %link', $link = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) {
     1771    echo get_previous_post_link( $format, $link, $in_same_term, $excluded_terms, $taxonomy );
    17721772}
    17731773
     
    17841784 * @return string
    17851785 */
    1786 function get_next_post_link( $format = '%link »', $link = '%title', $in_same_cat = false, $excluded_terms = '', $taxonomy = 'category' ) {
    1787     return get_adjacent_post_link( $format, $link, $in_same_cat, $excluded_terms, false, $taxonomy );
     1786function get_next_post_link( $format = '%link »', $link = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) {
     1787    return get_adjacent_post_link( $format, $link, $in_same_term, $excluded_terms, false, $taxonomy );
    17881788}
    17891789
     
    18001800 * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
    18011801 */
    1802 function next_post_link( $format = '%link »', $link = '%title', $in_same_cat = false, $excluded_terms = '', $taxonomy = 'category' ) {
    1803      echo get_next_post_link( $format, $link, $in_same_cat, $excluded_terms, $taxonomy );
     1802function next_post_link( $format = '%link »', $link = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) {
     1803     echo get_next_post_link( $format, $link, $in_same_term, $excluded_terms, $taxonomy );
    18041804}
    18051805
     
    18191819 * @return string
    18201820 */
    1821 function get_adjacent_post_link( $format, $link, $in_same_cat = false, $excluded_terms = '', $previous = true, $taxonomy = 'category' ) {
     1821function get_adjacent_post_link( $format, $link, $in_same_term = false, $excluded_terms = '', $previous = true, $taxonomy = 'category' ) {
    18221822    if ( $previous && is_attachment() )
    18231823        $post = get_post( get_post()->post_parent );
    18241824    else
    1825         $post = get_adjacent_post( $in_same_cat, $excluded_terms, $previous, $taxonomy );
     1825        $post = get_adjacent_post( $in_same_term, $excluded_terms, $previous, $taxonomy );
    18261826
    18271827    if ( ! $post ) {
     
    18751875 * @param string       $format         Link anchor format.
    18761876 * @param string       $link           Link permalink format.
    1877  * @param bool         $in_same_cat    Optional. Whether link should be in a same category.
     1877 * @param bool         $in_same_term   Optional. Whether link should be in a taxonomy term.
    18781878 * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded category IDs.
    18791879 * @param bool         $previous       Optional. Whether to display link to previous or next post. Default true.
     
    18811881 * @return string
    18821882 */
    1883 function adjacent_post_link( $format, $link, $in_same_cat = false, $excluded_terms = '', $previous = true, $taxonomy = 'category' ) {
    1884     echo get_adjacent_post_link( $format, $link, $in_same_cat, $excluded_terms, $previous, $taxonomy );
     1883function adjacent_post_link( $format, $link, $in_same_term = false, $excluded_terms = '', $previous = true, $taxonomy = 'category' ) {
     1884    echo get_adjacent_post_link( $format, $link, $in_same_term, $excluded_terms, $previous, $taxonomy );
    18851885}
    18861886
Note: See TracChangeset for help on using the changeset viewer.