Make WordPress Core

Changeset 60152


Ignore:
Timestamp:
04/12/2025 10:40:17 PM (2 weeks ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Correct $post parameter default values in link-template.php.

This commit corrects the default post ID parameter values used in several functions to bring them in line with their int doctypes (and the doctypes of their internal function calls).

More specifically,

  • get_page_link(): $post = false changed to $post = 0
  • _get_page_link(): $post = false changed to $post = 0
  • post_comments_feed_link(): $post_id = '' changed to $post_id = 0

Follow-up to [1752], [4475], [6365], [9136], [9274], [21735], [24490], [32606], [37252].

Props justlevine.
See #63268.

File:
1 edited

Legend:

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

    r60108 r60152  
    389389 * @return string The page permalink.
    390390 */
    391 function get_page_link( $post = false, $leavename = false, $sample = false ) {
     391function get_page_link( $post = 0, $leavename = false, $sample = false ) {
    392392    $post = get_post( $post );
    393393
     
    426426 * @return string The page permalink.
    427427 */
    428 function _get_page_link( $post = false, $leavename = false, $sample = false ) {
     428function _get_page_link( $post = 0, $leavename = false, $sample = false ) {
    429429    global $wp_rewrite;
    430430
     
    835835 *                          Default is the value of get_default_feed().
    836836 */
    837 function post_comments_feed_link( $link_text = '', $post_id = '', $feed = '' ) {
     837function post_comments_feed_link( $link_text = '', $post_id = 0, $feed = '' ) {
    838838    $url = get_post_comments_feed_link( $post_id, $feed );
    839839    if ( empty( $link_text ) ) {
Note: See TracChangeset for help on using the changeset viewer.