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/deprecated.php

    r53685 r53715  
    36323632 * @see get_permalink()
    36333633 *
    3634  * @param int|WP_Post $post_id Optional. Post ID or WP_Post object. Default is global $post.
     3634 * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post.
    36353635 * @return string|false
    36363636 */
    3637 function post_permalink( $post_id = 0 ) {
     3637function post_permalink( $post = 0 ) {
    36383638    _deprecated_function( __FUNCTION__, '4.4.0', 'get_permalink()' );
    36393639
    3640     return get_permalink( $post_id );
     3640    return get_permalink( $post );
    36413641}
    36423642
Note: See TracChangeset for help on using the changeset viewer.