Make WordPress Core


Ignore:
Timestamp:
07/18/2022 05:35:51 PM (2 years ago)
Author:
SergeyBiryukov
Message:

Posts, Post Types: Standardize on $post parameter name where appropriate.

This renames the $post_id or $id parameters to $post for functions that accept a post ID or post object:

  • get_sample_permalink()
  • get_sample_permalink_html()
  • wp_check_post_lock()
  • wp_set_post_lock()
  • get_the_tags()
  • comment_class()
  • get_comment_class()
  • get_comments_link()
  • get_comments_number()
  • comments_number()
  • get_comments_number_text()
  • comments_open()
  • pings_open()
  • comment_form()
  • do_trackbacks()
  • pingback()
  • post_permalink()
  • get_post_permalink()
  • get_edit_post_link()
  • edit_post_link()
  • get_delete_post_link()
  • post_class()
  • get_post_class()
  • the_attachment_link()
  • wp_get_attachment_link()
  • wp_list_post_revisions()
  • check_and_publish_future_post()
  • add_ping()
  • get_pung()
  • get_to_ping()
  • wp_get_post_revisions()
  • wp_get_post_revisions_url()

Additionally, $revision_id is renamed to $revision in:

  • wp_restore_post_revision()
  • wp_delete_post_revision()

Includes minor documentation improvements for consistency and code layout fixes for better readability.

Follow-up to [1599], [1794], [2881], [3303], [3851], [5302], [6633], [6716], [6985], [7103], [7149], [7747], [8011], [8638], [8643], [8695], [9138], [9273], [11425], [11922], [11956], [12284], [12810], [12923], [13023], [13171], [25567], [27156], [27473], [28558], [28602], [33659], [38852], [47276], [47366], [48622], [49544], [49597], [52095].

See #56243, #55647.

File:
1 edited

Legend:

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

    r53685 r53715  
    43004300 *     Arguments for enqueuing media scripts.
    43014301 *
    4302  *     @type int|WP_Post $post A post object or ID.
     4302 *     @type int|WP_Post $post Post ID or post object.
    43034303 * }
    43044304 */
Note: See TracChangeset for help on using the changeset viewer.