<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[53715] trunk/src: Posts, Post Types: Standardize on `$post` parameter name where appropriate.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/53715">53715</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/53715","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>SergeyBiryukov</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2022-07-18 17:35:51 +0000 (Mon, 18 Jul 2022)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>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 <a href="https://core.trac.wordpress.org/changeset/1599">[1599]</a>, <a href="https://core.trac.wordpress.org/changeset/1794">[1794]</a>, <a href="https://core.trac.wordpress.org/changeset/2881">[2881]</a>, <a href="https://core.trac.wordpress.org/changeset/3303">[3303]</a>, <a href="https://core.trac.wordpress.org/changeset/3851">[3851]</a>, <a href="https://core.trac.wordpress.org/changeset/5302">[5302]</a>, <a href="https://core.trac.wordpress.org/changeset/6633">[6633]</a>, <a href="https://core.trac.wordpress.org/changeset/6716">[6716]</a>, <a href="https://core.trac.wordpress.org/changeset/6985">[6985]</a>, <a href="https://core.trac.wordpress.org/changeset/7103">[7103]</a>, <a href="https://core.trac.wordpress.org/changeset/7149">[7149]</a>, <a href="https://core.trac.wordpress.org/changeset/7747">[7747]</a>, <a href="https://core.trac.wordpress.org/changeset/8011">[8011]</a>, <a href="https://core.trac.wordpress.org/changeset/8638">[8638]</a>, <a href="https://co
re.trac.wordpress.org/changeset/8643">[8643]</a>, <a href="https://core.trac.wordpress.org/changeset/8695">[8695]</a>, <a href="https://core.trac.wordpress.org/changeset/9138">[9138]</a>, <a href="https://core.trac.wordpress.org/changeset/9273">[9273]</a>, <a href="https://core.trac.wordpress.org/changeset/11425">[11425]</a>, <a href="https://core.trac.wordpress.org/changeset/11922">[11922]</a>, <a href="https://core.trac.wordpress.org/changeset/11956">[11956]</a>, <a href="https://core.trac.wordpress.org/changeset/12284">[12284]</a>, <a href="https://core.trac.wordpress.org/changeset/12810">[12810]</a>, <a href="https://core.trac.wordpress.org/changeset/12923">[12923]</a>, <a href="https://core.trac.wordpress.org/changeset/13023">[13023]</a>, <a href="https://core.trac.wordpress.org/changeset/13171">[13171]</a>, <a href="https://core.trac.wordpress.org/changeset/25567">[25567]</a>, <a href="https://core.trac.wordpress.org/changeset/27156">[27156]</a>, <a href="https://core.trac.wor
dpress.org/changeset/27473">[27473]</a>, <a href="https://core.trac.wordpress.org/changeset/28558">[28558]</a>, <a href="https://core.trac.wordpress.org/changeset/28602">[28602]</a>, <a href="https://core.trac.wordpress.org/changeset/33659">[33659]</a>, <a href="https://core.trac.wordpress.org/changeset/38852">[38852]</a>, <a href="https://core.trac.wordpress.org/changeset/47276">[47276]</a>, <a href="https://core.trac.wordpress.org/changeset/47366">[47366]</a>, <a href="https://core.trac.wordpress.org/changeset/48622">[48622]</a>, <a href="https://core.trac.wordpress.org/changeset/49544">[49544]</a>, <a href="https://core.trac.wordpress.org/changeset/49597">[49597]</a>, <a href="https://core.trac.wordpress.org/changeset/52095">[52095]</a>.
See <a href="https://core.trac.wordpress.org/ticket/56243">#56243</a>, <a href="https://core.trac.wordpress.org/ticket/55647">#55647</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminincludespostphp">trunk/src/wp-admin/includes/post.php</a></li>
<li><a href="#trunksrcwpincludescategorytemplatephp">trunk/src/wp-includes/category-template.php</a></li>
<li><a href="#trunksrcwpincludescommenttemplatephp">trunk/src/wp-includes/comment-template.php</a></li>
<li><a href="#trunksrcwpincludescommentphp">trunk/src/wp-includes/comment.php</a></li>
<li><a href="#trunksrcwpincludesdeprecatedphp">trunk/src/wp-includes/deprecated.php</a></li>
<li><a href="#trunksrcwpincludesembedphp">trunk/src/wp-includes/embed.php</a></li>
<li><a href="#trunksrcwpincludesgeneraltemplatephp">trunk/src/wp-includes/general-template.php</a></li>
<li><a href="#trunksrcwpincludeslinktemplatephp">trunk/src/wp-includes/link-template.php</a></li>
<li><a href="#trunksrcwpincludesmediaphp">trunk/src/wp-includes/media.php</a></li>
<li><a href="#trunksrcwpincludesposttemplatephp">trunk/src/wp-includes/post-template.php</a></li>
<li><a href="#trunksrcwpincludespostphp">trunk/src/wp-includes/post.php</a></li>
<li><a href="#trunksrcwpincludesrevisionphp">trunk/src/wp-includes/revision.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminincludespostphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/post.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/post.php 2022-07-17 02:16:27 UTC (rev 53714)
+++ trunk/src/wp-admin/includes/post.php 2022-07-18 17:35:51 UTC (rev 53715)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1376,7 +1376,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|WP_Post $id Post ID or post object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $post Post ID or post object.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string|null $title Optional. Title to override the post's current title
</span><span class="cx" style="display: block; padding: 0 10px"> * when generating the post name. Default null.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string|null $name Optional. Name to override the post name. Default null.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1387,8 +1387,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @type string $1 The post name.
</span><span class="cx" style="display: block; padding: 0 10px"> * }
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function get_sample_permalink( $id, $title = null, $name = null ) {
- $post = get_post( $id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function get_sample_permalink( $post, $title = null, $name = null ) {
+ $post = get_post( $post );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return array( '', '' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1468,13 +1469,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|WP_Post $id Post ID or post object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $post Post ID or post object.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string|null $new_title Optional. New title. Default null.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string|null $new_slug Optional. New slug. Default null.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string The HTML of the sample permalink slug editor.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
- $post = get_post( $id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function get_sample_permalink_html( $post, $new_title = null, $new_slug = null ) {
+ $post = get_post( $post );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return '';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1511,7 +1513,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Encourage a pretty permalink setting.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! get_option( 'permalink_structure' ) && current_user_can( 'manage_options' )
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- && ! ( 'page' === get_option( 'show_on_front' ) && get_option( 'page_on_front' ) == $id )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ && ! ( 'page' === get_option( 'show_on_front' ) && get_option( 'page_on_front' ) == $post->ID )
</ins><span class="cx" style="display: block; padding: 0 10px"> ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $return .= '<span id="change-permalinks"><a href="options-permalink.php" class="button button-small">' . __( 'Change Permalink Structure' ) . "</a></span>\n";
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1628,17 +1630,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|WP_Post $post_id ID or object of the post to check for editing.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $post ID or object of the post to check for editing.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return int|false ID of the user with lock. False if the post does not exist, post is not locked,
</span><span class="cx" style="display: block; padding: 0 10px"> * the user with lock does not exist, or the post is locked by current user.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function wp_check_post_lock( $post_id ) {
- $post = get_post( $post_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function wp_check_post_lock( $post ) {
+ $post = get_post( $post );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $lock = get_post_meta( $post->ID, '_edit_lock', true );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $lock ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1666,7 +1670,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|WP_Post $post_id ID or object of the post being edited.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $post ID or object of the post being edited.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return array|false {
</span><span class="cx" style="display: block; padding: 0 10px"> * Array of the lock time and user ID. False if the post does not exist, or there
</span><span class="cx" style="display: block; padding: 0 10px"> * is no current user.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1675,13 +1679,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @type int $1 The ID of the current user.
</span><span class="cx" style="display: block; padding: 0 10px"> * }
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function wp_set_post_lock( $post_id ) {
- $post = get_post( $post_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function wp_set_post_lock( $post ) {
+ $post = get_post( $post );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $user_id = get_current_user_id();
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( 0 == $user_id ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1701,6 +1707,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function _admin_notice_post_locked() {
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post();
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1707,6 +1714,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $user = null;
</span><span class="cx" style="display: block; padding: 0 10px"> $user_id = wp_check_post_lock( $post->ID );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $user_id ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $user = get_userdata( $user_id );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1936,6 +1944,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $_POST['ID'] = $post_ID;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post_ID );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_die( __( 'Sorry, you are not allowed to edit this post.' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludescategorytemplatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/category-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/category-template.php 2022-07-17 02:16:27 UTC (rev 53714)
+++ trunk/src/wp-includes/category-template.php 2022-07-18 17:35:51 UTC (rev 53715)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -90,10 +90,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Filters the array of categories to return for a post.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.1.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @since 4.4.0 Added `$post_id` parameter.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 4.4.0 Added the `$post_id` parameter.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param WP_Term[] $categories An array of categories to return for the post.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|false $post_id ID of the post.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|false $post_id The post ID.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> return apply_filters( 'get_the_categories', $categories, $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -133,8 +133,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $separator Optional. Separator between the categories. By default, the links are placed
</span><span class="cx" style="display: block; padding: 0 10px"> * in an unordered list. An empty string will result in the default behavior.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $parents Optional. How to display the parents.
- * @param int $post_id Optional. Post ID to retrieve categories.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $parents Optional. How to display the parents. Accepts 'multiple', 'single', or empty.
+ * Default empty string.
+ * @param int $post_id Optional. ID of the post to retrieve categories for. Defaults to the current post.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return string Category list for a post.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function get_the_category_list( $separator = '', $parents = '', $post_id = false ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -151,8 +152,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.4.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param WP_Term[] $categories An array of the post's categories.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|bool $post_id ID of the post we're retrieving categories for.
- * When `false`, we assume the current post in the loop.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|false $post_id ID of the post to retrieve categories for.
+ * When `false`, defaults to the current post in the loop.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $categories = apply_filters( 'the_category_list', get_the_category( $post_id ), $post_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -250,7 +251,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int|string|int[]|string[] $category Category ID, name, slug, or array of such
</span><span class="cx" style="display: block; padding: 0 10px"> * to check against.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|object $post Optional. Post to check instead of the current post.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $post Optional. Post to check. Defaults to the current post.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return bool True if the current post is in any of the given categories.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function in_category( $category, $post = null ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -268,8 +269,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $separator Optional. Separator between the categories. By default, the links are placed
</span><span class="cx" style="display: block; padding: 0 10px"> * in an unordered list. An empty string will result in the default behavior.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $parents Optional. How to display the parents.
- * @param int $post_id Optional. Post ID to retrieve categories.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $parents Optional. How to display the parents. Accepts 'multiple', 'single', or empty.
+ * Default empty string.
+ * @param int $post_id Optional. ID of the post to retrieve categories for. Defaults to the current post.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function the_category( $separator = '', $parents = '', $post_id = false ) {
</span><span class="cx" style="display: block; padding: 0 10px"> echo get_the_category_list( $separator, $parents, $post_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1161,12 +1163,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.3.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|WP_Post $post_id Post ID or object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $post Post ID or object.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return WP_Term[]|false|WP_Error Array of WP_Term objects on success, false if there are no terms
</span><span class="cx" style="display: block; padding: 0 10px"> * or the post does not exist, WP_Error on failure.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function get_the_tags( $post_id = 0 ) {
- $terms = get_the_terms( $post_id, 'post_tag' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function get_the_tags( $post = 0 ) {
+ $terms = get_the_terms( $post, 'post_tag' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filters the array of tags for the given post.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1278,11 +1280,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function get_the_terms( $post, $taxonomy ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $terms = get_object_term_cache( $post->ID, $taxonomy );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( false === $terms ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $terms = wp_get_object_terms( $post->ID, $taxonomy );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! is_wp_error( $terms ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1476,7 +1480,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string|int|array $category Optional. The category name/term_id/slug,
</span><span class="cx" style="display: block; padding: 0 10px"> * or an array of them to check for. Default empty.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|object $post Optional. Post to check instead of the current post.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $post Optional. Post to check. Defaults to the current post.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return bool True if the current post has any of the given categories
</span><span class="cx" style="display: block; padding: 0 10px"> * (or any category, if no category specified). False otherwise.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1503,7 +1507,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string|int|array $tag Optional. The tag name/term_id/slug,
</span><span class="cx" style="display: block; padding: 0 10px"> * or an array of them to check for. Default empty.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|object $post Optional. Post to check instead of the current post.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $post Optional. Post to check. Defaults to the current post.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return bool True if the current post has any of the given tags
</span><span class="cx" style="display: block; padding: 0 10px"> * (or any tag, if no tag specified). False otherwise.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1524,7 +1528,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string|int|array $term Optional. The term name/term_id/slug,
</span><span class="cx" style="display: block; padding: 0 10px"> * or an array of them to check for. Default empty.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $taxonomy Optional. Taxonomy name. Default empty.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|WP_Post $post Optional. Post to check instead of the current post.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $post Optional. Post to check. Defaults to the current post.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return bool True if the current post has any of the given terms
</span><span class="cx" style="display: block; padding: 0 10px"> * (or any term, if no term specified). False otherwise.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span></span></pre></div>
<a id="trunksrcwpincludescommenttemplatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/comment-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/comment-template.php 2022-07-17 02:16:27 UTC (rev 53714)
+++ trunk/src/wp-includes/comment-template.php 2022-07-18 17:35:51 UTC (rev 53715)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -426,14 +426,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string|string[] $css_class Optional. One or more classes to add to the class list.
</span><span class="cx" style="display: block; padding: 0 10px"> * Default empty.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int|WP_Comment $comment Comment ID or WP_Comment object. Default current comment.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|WP_Post $post_id Post ID or WP_Post object. Default current post.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $post Post ID or WP_Post object. Default current post.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param bool $display Optional. Whether to print or return the output.
</span><span class="cx" style="display: block; padding: 0 10px"> * Default true.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return void|string Void if `$display` argument is true, comment classes if `$display` is false.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function comment_class( $css_class = '', $comment = null, $post_id = null, $display = true ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function comment_class( $css_class = '', $comment = null, $post = null, $display = true ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> // Separates classes with a single space, collates classes for comment DIV.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $css_class = 'class="' . implode( ' ', get_comment_class( $css_class, $comment, $post_id ) ) . '"';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $css_class = 'class="' . implode( ' ', get_comment_class( $css_class, $comment, $post ) ) . '"';
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $display ) {
</span><span class="cx" style="display: block; padding: 0 10px"> echo $css_class;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -454,10 +454,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string|string[] $css_class Optional. One or more classes to add to the class list. Default empty.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int|WP_Comment $comment_id Comment ID or WP_Comment object. Default current comment.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|WP_Post $post_id Post ID or WP_Post object. Default current post.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $post Post ID or WP_Post object. Default current post.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return string[] An array of classes.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function get_comment_class( $css_class = '', $comment_id = null, $post_id = null ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function get_comment_class( $css_class = '', $comment_id = null, $post = null ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> global $comment_alt, $comment_depth, $comment_thread_alt;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $classes = array();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -476,9 +476,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $classes[] = 'byuser';
</span><span class="cx" style="display: block; padding: 0 10px"> $classes[] = 'comment-author-' . sanitize_html_class( $user->user_nicename, $comment->user_id );
</span><span class="cx" style="display: block; padding: 0 10px"> // For comment authors who are the author of the post.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $post = get_post( $post_id );
- if ( $post ) {
- if ( $comment->user_id === $post->post_author ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $_post = get_post( $post );
+ if ( $_post ) {
+ if ( $comment->user_id === $_post->post_author ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $classes[] = 'bypostauthor';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -534,9 +534,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string[] $css_class An array of additional classes added to the list.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $comment_id The comment ID as a numeric string.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param WP_Comment $comment The comment object.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|WP_Post $post_id The post ID or WP_Post object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $post The post ID or WP_Post object.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return apply_filters( 'comment_class', $classes, $css_class, $comment->comment_ID, $comment, $post_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return apply_filters( 'comment_class', $classes, $css_class, $comment->comment_ID, $comment, $post );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -808,12 +808,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|WP_Post $post_id Optional. Post ID or WP_Post object. Default is global $post.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return string The link to the comments.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function get_comments_link( $post_id = 0 ) {
- $hash = get_comments_number( $post_id ) ? '#comments' : '#respond';
- $comments_link = get_permalink( $post_id ) . $hash;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function get_comments_link( $post = 0 ) {
+ $hash = get_comments_number( $post ) ? '#comments' : '#respond';
+ $comments_link = get_permalink( $post ) . $hash;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filters the returned post comments permalink.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -821,9 +821,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.6.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $comments_link Post comments permalink with '#comments' appended.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|WP_Post $post_id Post ID or WP_Post object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $post Post ID or WP_Post object.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return apply_filters( 'get_comments_link', $comments_link, $post_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return apply_filters( 'get_comments_link', $comments_link, $post );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -849,19 +849,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|WP_Post $post_id Optional. Post ID or WP_Post object. Default is the global `$post`.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is the global `$post`.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return string|int If the post exists, a numeric string representing the number of comments
</span><span class="cx" style="display: block; padding: 0 10px"> * the post has, otherwise 0.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function get_comments_number( $post_id = 0 ) {
- $post = get_post( $post_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function get_comments_number( $post = 0 ) {
+ $post = get_post( $post );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! $post ) {
- $count = 0;
- } else {
- $count = $post->comment_count;
- $post_id = $post->ID;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $count = $post ? $post->comment_count : 0;
+ $post_id = $post ? $post->ID : 0;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filters the returned comment count for a post.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -878,15 +874,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Displays the language string for the number of comments the current post has.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 0.71
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @since 5.4.0 The `$deprecated` parameter was changed to `$post_id`.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 5.4.0 The `$deprecated` parameter was changed to `$post`.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string|false $zero Optional. Text for no comments. Default false.
- * @param string|false $one Optional. Text for one comment. Default false.
- * @param string|false $more Optional. Text for more than one comment. Default false.
- * @param int|WP_Post $post_id Optional. Post ID or WP_Post object. Default is the global `$post`.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|false $zero Optional. Text for no comments. Default false.
+ * @param string|false $one Optional. Text for one comment. Default false.
+ * @param string|false $more Optional. Text for more than one comment. Default false.
+ * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is the global `$post`.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function comments_number( $zero = false, $one = false, $more = false, $post_id = 0 ) {
- echo get_comments_number_text( $zero, $one, $more, $post_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function comments_number( $zero = false, $one = false, $more = false, $post = 0 ) {
+ echo get_comments_number_text( $zero, $one, $more, $post );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -893,16 +889,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Displays the language string for the number of comments the current post has.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.0.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @since 5.4.0 Added the `$post_id` parameter to allow using the function outside of the loop.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 5.4.0 Added the `$post` parameter to allow using the function outside of the loop.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $zero Optional. Text for no comments. Default false.
- * @param string $one Optional. Text for one comment. Default false.
- * @param string $more Optional. Text for more than one comment. Default false.
- * @param int|WP_Post $post_id Optional. Post ID or WP_Post object. Default is the global `$post`.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $zero Optional. Text for no comments. Default false.
+ * @param string $one Optional. Text for one comment. Default false.
+ * @param string $more Optional. Text for more than one comment. Default false.
+ * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is the global `$post`.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return string Language string for the number of comments a post has.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function get_comments_number_text( $zero = false, $one = false, $more = false, $post_id = 0 ) {
- $number = get_comments_number( $post_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function get_comments_number_text( $zero = false, $one = false, $more = false, $post = 0 ) {
+ $number = get_comments_number( $post );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $number > 1 ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( false === $more ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1235,13 +1231,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|WP_Post $post_id Post ID or WP_Post object. Default current post.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $post Post ID or WP_Post object. Default current post.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return bool True if the comments are open.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function comments_open( $post_id = null ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function comments_open( $post = null ) {
+ $_post = get_post( $post );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $_post = get_post( $post_id );
-
</del><span class="cx" style="display: block; padding: 0 10px"> $post_id = $_post ? $_post->ID : 0;
</span><span class="cx" style="display: block; padding: 0 10px"> $open = ( $_post && ( 'open' === $_post->comment_status ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1265,13 +1260,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|WP_Post $post_id Post ID or WP_Post object. Default current post.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $post Post ID or WP_Post object. Default current post.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return bool True if pings are accepted
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function pings_open( $post_id = null ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function pings_open( $post = null ) {
+ $_post = get_post( $post );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $_post = get_post( $post_id );
-
</del><span class="cx" style="display: block; padding: 0 10px"> $post_id = $_post ? $_post->ID : 0;
</span><span class="cx" style="display: block; padding: 0 10px"> $open = ( $_post && ( 'open' === $_post->ping_status ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1515,7 +1509,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.1.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $comments Array of comments supplied to the comments template.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int $post_ID Post ID.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $post_id Post ID.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_query->comments = apply_filters( 'comments_array', $comments_flat, $post->ID );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2324,13 +2318,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * submit button markup and %2$s is the comment hidden fields.
</span><span class="cx" style="display: block; padding: 0 10px"> * @type string $format The comment form format. Default 'xhtml'. Accepts 'xhtml', 'html5'.
</span><span class="cx" style="display: block; padding: 0 10px"> * }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|WP_Post $post_id Post ID or WP_Post object to generate the form for. Default current post.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $post Post ID or WP_Post object to generate the form for. Default current post.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function comment_form( $args = array(), $post_id = null ) {
- if ( null === $post_id ) {
- $post_id = get_the_ID();
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function comment_form( $args = array(), $post = null ) {
+ $post = get_post( $post );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_id = $post ? $post->ID : get_the_ID();
+
</ins><span class="cx" style="display: block; padding: 0 10px"> // Exit the function when comments for the post are closed.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! comments_open( $post_id ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunksrcwpincludescommentphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/comment.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/comment.php 2022-07-17 02:16:27 UTC (rev 53714)
+++ trunk/src/wp-includes/comment.php 2022-07-18 17:35:51 UTC (rev 53715)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -149,7 +149,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Retrieves the approved comments for post $post_id.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Retrieves the approved comments for a post.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.0.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.1.0 Refactored to leverage WP_Comment_Query over a direct query.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -859,7 +859,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return bool Whether comment flooding is occurring.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_check_comment_flood( $is_flood, $ip, $email, $date, $avoid_die = false ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> global $wpdb;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Another callback has declared a flood. Trust it.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1447,6 +1446,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_delete_comment( $comment_id, $force_delete = false ) {
</span><span class="cx" style="display: block; padding: 0 10px"> global $wpdb;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> $comment = get_comment( $comment_id );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $comment ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1991,6 +1991,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_insert_comment( $commentdata ) {
</span><span class="cx" style="display: block; padding: 0 10px"> global $wpdb;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = wp_unslash( $commentdata );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $comment_author = ! isset( $data['comment_author'] ) ? '' : $data['comment_author'];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2651,7 +2652,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_update_comment_count_now( $post_id ) {
</span><span class="cx" style="display: block; padding: 0 10px"> global $wpdb;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> $post_id = (int) $post_id;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post_id ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2660,6 +2663,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_cache_delete( "comments-{$post_id}", 'counts' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post_id );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2886,15 +2890,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Performs trackbacks.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.5.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @since 4.7.0 `$post_id` can be a WP_Post object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 4.7.0 `$post` can be a WP_Post object.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @global wpdb $wpdb WordPress database abstraction object.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|WP_Post $post_id Post object or ID to do trackbacks on.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $post Post ID or object to do trackbacks on.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function do_trackbacks( $post_id ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function do_trackbacks( $post ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> global $wpdb;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $post = get_post( $post_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ $post = get_post( $post );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2901,6 +2907,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $to_ping = get_to_ping( $post );
</span><span class="cx" style="display: block; padding: 0 10px"> $pinged = get_pung( $post );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $to_ping ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $wpdb->update( $wpdb->posts, array( 'to_ping' => '' ), array( 'ID' => $post->ID ) );
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2947,7 +2954,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.2.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $post_id Post ID.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return int Same as Post ID from parameter
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return int Same post ID as provided.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function generic_ping( $post_id = 0 ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $services = get_option( 'ping_sites' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2967,12 +2974,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Pings back the links found in a post.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 0.71
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @since 4.7.0 `$post_id` can be a WP_Post object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 4.7.0 `$post` can be a WP_Post object.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $content Post content to check for links. If empty will retrieve from post.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|WP_Post $post_id Post Object or ID.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $post Post ID or object.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function pingback( $content, $post_id ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function pingback( $content, $post ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> include_once ABSPATH . WPINC . '/class-IXR.php';
</span><span class="cx" style="display: block; padding: 0 10px"> include_once ABSPATH . WPINC . '/class-wp-http-ixr-client.php';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2979,7 +2986,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Original code by Mort (http://mort.mine.nu:8080).
</span><span class="cx" style="display: block; padding: 0 10px"> $post_links = array();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $post = get_post( $post_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post = get_post( $post );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3032,7 +3040,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string[] $post_links Array of link URLs to be checked (passed by reference).
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string[] $pung Array of link URLs already pinged (passed by reference).
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int $post_ID The post ID.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $post_id The post ID.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> do_action_ref_array( 'pre_ping', array( &$post_links, &$pung, $post->ID ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpincludesdeprecatedphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/deprecated.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/deprecated.php 2022-07-17 02:16:27 UTC (rev 53714)
+++ trunk/src/wp-includes/deprecated.php 2022-07-18 17:35:51 UTC (rev 53715)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3631,13 +3631,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @deprecated 4.4.0 Use get_permalink()
</span><span class="cx" style="display: block; padding: 0 10px"> * @see get_permalink()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|WP_Post $post_id Optional. Post ID or WP_Post object. Default is global $post.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return string|false
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function post_permalink( $post_id = 0 ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function post_permalink( $post = 0 ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> _deprecated_function( __FUNCTION__, '4.4.0', 'get_permalink()' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return get_permalink( $post_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return get_permalink( $post );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunksrcwpincludesembedphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/embed.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/embed.php 2022-07-17 02:16:27 UTC (rev 53714)
+++ trunk/src/wp-includes/embed.php 2022-07-18 17:35:51 UTC (rev 53715)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -537,7 +537,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.4.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param WP_Post|int $post Post object or ID.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param WP_Post|int $post Post ID or post object.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param int $width The requested width.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array|false Response data on success, false if post doesn't exist
</span><span class="cx" style="display: block; padding: 0 10px"> * or is not publicly viewable.
</span></span></pre></div>
<a id="trunksrcwpincludesgeneraltemplatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/general-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/general-template.php 2022-07-17 02:16:27 UTC (rev 53714)
+++ trunk/src/wp-includes/general-template.php 2022-07-18 17:35:51 UTC (rev 53715)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2680,7 +2680,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $format Optional. Format to use for retrieving the time the post
</span><span class="cx" style="display: block; padding: 0 10px"> * was written. Accepts 'G', 'U', or PHP date format.
</span><span class="cx" style="display: block; padding: 0 10px"> * Defaults to the 'time_format' option.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|WP_Post $post WP_Post object or ID. Default is global `$post` object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $post Post ID or post object. Default is global `$post` object.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return string|int|false Formatted date string or Unix timestamp if `$format` is 'U' or 'G'.
</span><span class="cx" style="display: block; padding: 0 10px"> * False on failure.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2716,7 +2716,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $format Optional. Format to use for retrieving the time the post
</span><span class="cx" style="display: block; padding: 0 10px"> * was written. Accepts 'G', 'U', or PHP date format. Default 'U'.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $gmt Optional. Whether to retrieve the GMT time. Default false.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|WP_Post $post WP_Post object or ID. Default is global `$post` object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $post Post ID or post object. Default is global `$post` object.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param bool $translate Whether to translate the time string. Default false.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string|int|false Formatted date string or Unix timestamp if `$format` is 'U' or 'G'.
</span><span class="cx" style="display: block; padding: 0 10px"> * False on failure.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2777,7 +2777,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 5.3.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|WP_Post $post Optional. WP_Post object or ID. Default is global `$post` object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $post Optional. Post ID or post object. Default is global `$post` object.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $field Optional. Published or modified time to use from database. Accepts 'date' or 'modified'.
</span><span class="cx" style="display: block; padding: 0 10px"> * Default 'date'.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $source Optional. Local or UTC time to use from database. Accepts 'local' or 'gmt'.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2822,7 +2822,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 5.3.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|WP_Post $post Optional. WP_Post object or ID. Default is global `$post` object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $post Optional. Post ID or post object. Default is global `$post` object.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $field Optional. Published or modified time to use from database. Accepts 'date' or 'modified'.
</span><span class="cx" style="display: block; padding: 0 10px"> * Default 'date'.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return int|false Unix timestamp on success, false on failure.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2905,7 +2905,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $format Optional. Format to use for retrieving the time the post
</span><span class="cx" style="display: block; padding: 0 10px"> * was modified. Accepts 'G', 'U', or PHP date format. Default 'U'.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $gmt Optional. Whether to retrieve the GMT time. Default false.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|WP_Post $post WP_Post object or ID. Default is global `$post` object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $post Post ID or post object. Default is global `$post` object.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param bool $translate Whether to translate the time string. Default false.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string|int|false Formatted date string or Unix timestamp if `$format` is 'U' or 'G'.
</span><span class="cx" style="display: block; padding: 0 10px"> * False on failure.
</span></span></pre></div>
<a id="trunksrcwpincludeslinktemplatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/link-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/link-template.php 2022-07-17 02:16:27 UTC (rev 53714)
+++ trunk/src/wp-includes/link-template.php 2022-07-18 17:35:51 UTC (rev 53715)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -311,15 +311,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @global WP_Rewrite $wp_rewrite WordPress rewrite component.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|WP_Post $id Optional. Post ID or post object. Default is the global `$post`.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $post Optional. Post ID or post object. Default is the global `$post`.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param bool $leavename Optional. Whether to keep post name. Default false.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $sample Optional. Is it a sample permalink. Default false.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string|WP_Error The post permalink.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function get_post_permalink( $id = 0, $leavename = false, $sample = false ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function get_post_permalink( $post = 0, $leavename = false, $sample = false ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> global $wp_rewrite;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $post = get_post( $id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post = get_post( $post );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_wp_error( $post ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $post;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1298,6 +1298,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> global $wp_rewrite;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post_type_obj = get_post_type_object( $post_type );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post_type_obj ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1402,6 +1403,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function get_preview_post_link( $post = null, $query_args = array(), $preview_link = '' ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1436,13 +1438,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.3.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|WP_Post $id Optional. Post ID or post object. Default is the global `$post`.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $post Optional. Post ID or post object. Default is the global `$post`.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $context Optional. How to output the '&' character. Default '&'.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string|null The edit post link for the given post. Null if the post type does not exist
</span><span class="cx" style="display: block; padding: 0 10px"> * or does not allow an editing UI.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function get_edit_post_link( $id = 0, $context = 'display' ) {
- $post = get_post( $id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function get_edit_post_link( $post = 0, $context = 'display' ) {
+ $post = get_post( $post );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1456,6 +1459,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post_type_object = get_post_type_object( $post->post_type );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post_type_object ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1492,16 +1496,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $text Optional. Anchor text. If null, default is 'Edit This'. Default null.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $before Optional. Display before edit link. Default empty.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $after Optional. Display after edit link. Default empty.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|WP_Post $id Optional. Post ID or post object. Default is the global `$post`.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $post Optional. Post ID or post object. Default is the global `$post`.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $class Optional. Add custom class to link. Default 'post-edit-link'.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function edit_post_link( $text = null, $before = '', $after = '', $id = 0, $class = 'post-edit-link' ) {
- $post = get_post( $id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function edit_post_link( $text = null, $before = '', $after = '', $post = 0, $class = 'post-edit-link' ) {
+ $post = get_post( $post );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $url = get_edit_post_link( $post->ID );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $url ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1531,22 +1537,24 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.9.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|WP_Post $id Optional. Post ID or post object. Default is the global `$post`.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $post Optional. Post ID or post object. Default is the global `$post`.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $deprecated Not used.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $force_delete Optional. Whether to bypass Trash and force deletion. Default false.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string|void The delete post link URL for the given post.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function get_delete_post_link( $id = 0, $deprecated = '', $force_delete = false ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function get_delete_post_link( $post = 0, $deprecated = '', $force_delete = false ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $deprecated ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> _deprecated_argument( __FUNCTION__, '3.0.0' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $post = get_post( $id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post = get_post( $post );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post_type_object = get_post_type_object( $post->post_type );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post_type_object ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1788,6 +1796,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> global $wpdb;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post();
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post || ! taxonomy_exists( $taxonomy ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return null;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2132,6 +2141,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function get_boundary_post( $in_same_term = false, $excluded_terms = '', $start = true, $taxonomy = 'category' ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post();
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post || ! is_single() || is_attachment() || ! taxonomy_exists( $taxonomy ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return null;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludesmediaphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/media.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/media.php 2022-07-17 02:16:27 UTC (rev 53714)
+++ trunk/src/wp-includes/media.php 2022-07-18 17:35:51 UTC (rev 53715)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4299,7 +4299,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $args {
</span><span class="cx" style="display: block; padding: 0 10px"> * Arguments for enqueuing media scripts.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type int|WP_Post $post A post object or ID.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @type int|WP_Post $post Post ID or post object.
</ins><span class="cx" style="display: block; padding: 0 10px"> * }
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_enqueue_media( $args = array() ) {
</span></span></pre></div>
<a id="trunksrcwpincludesposttemplatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/post-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/post-template.php 2022-07-17 02:16:27 UTC (rev 53714)
+++ trunk/src/wp-includes/post-template.php 2022-07-18 17:35:51 UTC (rev 53715)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -117,8 +117,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function get_the_title( $post = 0 ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $title = isset( $post->post_title ) ? $post->post_title : '';
- $id = isset( $post->ID ) ? $post->ID : 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_title = isset( $post->post_title ) ? $post->post_title : '';
+ $post_id = isset( $post->ID ) ? $post->ID : 0;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! is_admin() ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $post->post_password ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -138,7 +138,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param WP_Post $post Current post object.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $protected_title_format = apply_filters( 'protected_title_format', $prepend, $post );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $title = sprintf( $protected_title_format, $title );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ $post_title = sprintf( $protected_title_format, $post_title );
</ins><span class="cx" style="display: block; padding: 0 10px"> } elseif ( isset( $post->post_status ) && 'private' === $post->post_status ) {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /* translators: %s: Private post title. */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -156,7 +157,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param WP_Post $post Current post object.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $private_title_format = apply_filters( 'private_title_format', $prepend, $post );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $title = sprintf( $private_title_format, $title );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ $post_title = sprintf( $private_title_format, $post_title );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -165,10 +167,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 0.71
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $title The post title.
- * @param int $id The post ID.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $post_title The post title.
+ * @param int $post_id The post ID.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return apply_filters( 'the_title', $title, $id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return apply_filters( 'the_title', $post_title, $post_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -187,8 +189,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function the_guid( $post = 0 ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $guid = isset( $post->guid ) ? get_the_guid( $post ) : '';
- $id = isset( $post->ID ) ? $post->ID : 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_guid = isset( $post->guid ) ? get_the_guid( $post ) : '';
+ $post_id = isset( $post->ID ) ? $post->ID : 0;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filters the escaped Global Unique Identifier (guid) of the post.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -197,10 +199,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see get_the_guid()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $guid Escaped Global Unique Identifier (guid) of the post.
- * @param int $id The post ID.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $post_guid Escaped Global Unique Identifier (guid) of the post.
+ * @param int $post_id The post ID.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo apply_filters( 'the_guid', $guid, $id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ echo apply_filters( 'the_guid', $post_guid, $post_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -218,8 +220,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function get_the_guid( $post = 0 ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $guid = isset( $post->guid ) ? $post->guid : '';
- $id = isset( $post->ID ) ? $post->ID : 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_guid = isset( $post->guid ) ? $post->guid : '';
+ $post_id = isset( $post->ID ) ? $post->ID : 0;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filters the Global Unique Identifier (guid) of the post.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -226,10 +228,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $guid Global Unique Identifier (guid) of the post.
- * @param int $id The post ID.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $post_guid Global Unique Identifier (guid) of the post.
+ * @param int $post_id The post ID.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return apply_filters( 'get_the_guid', $guid, $id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return apply_filters( 'get_the_guid', $post_guid, $post_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -451,12 +453,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.7.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string|string[] $class One or more classes to add to the class list.
- * @param int|WP_Post $post_id Optional. Post ID or post object. Defaults to the global `$post`.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|string[] $class One or more classes to add to the class list.
+ * @param int|WP_Post $post Optional. Post ID or post object. Defaults to the global `$post`.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function post_class( $class = '', $post_id = null ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function post_class( $class = '', $post = null ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> // Separates classes with a single space, collates classes for post DIV.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo 'class="' . esc_attr( implode( ' ', get_post_class( $class, $post_id ) ) ) . '"';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ echo 'class="' . esc_attr( implode( ' ', get_post_class( $class, $post ) ) ) . '"';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -476,12 +478,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.7.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.2.0 Custom taxonomy class names were added.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string|string[] $class Space-separated string or array of class names to add to the class list.
- * @param int|WP_Post $post_id Optional. Post ID or post object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|string[] $class Space-separated string or array of class names to add to the class list.
+ * @param int|WP_Post $post Optional. Post ID or post object.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return string[] Array of class names.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function get_post_class( $class = '', $post_id = null ) {
- $post = get_post( $post_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function get_post_class( $class = '', $post = null ) {
+ $post = get_post( $post );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $classes = array();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1580,20 +1582,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.0.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|WP_Post $id Optional. Post ID or post object.
- * @param bool $fullsize Optional. Whether to use full size. Default false.
- * @param bool $deprecated Deprecated. Not used.
- * @param bool $permalink Optional. Whether to include permalink. Default false.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $post Optional. Post ID or post object.
+ * @param bool $fullsize Optional. Whether to use full size. Default false.
+ * @param bool $deprecated Deprecated. Not used.
+ * @param bool $permalink Optional. Whether to include permalink. Default false.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function the_attachment_link( $id = 0, $fullsize = false, $deprecated = false, $permalink = false ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function the_attachment_link( $post = 0, $fullsize = false, $deprecated = false, $permalink = false ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $deprecated ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> _deprecated_argument( __FUNCTION__, '2.5.0' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $fullsize ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo wp_get_attachment_link( $id, 'full', $permalink );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ echo wp_get_attachment_link( $post, 'full', $permalink );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo wp_get_attachment_link( $id, 'thumbnail', $permalink );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ echo wp_get_attachment_link( $post, 'thumbnail', $permalink );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1601,9 +1603,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Retrieves an attachment page link using an image or icon, if possible.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @since 4.4.0 The `$id` parameter can now accept either a post ID or `WP_Post` object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 4.4.0 The `$post` parameter can now accept either a post ID or `WP_Post` object.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|WP_Post $id Optional. Post ID or post object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $post Optional. Post ID or post object.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array
</span><span class="cx" style="display: block; padding: 0 10px"> * of width and height values in pixels (in that order). Default 'thumbnail'.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $permalink Optional. Whether to add permalink to image. Default false.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1613,8 +1615,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array|string $attr Optional. Array or string of attributes. Default empty.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string HTML content.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function wp_get_attachment_link( $id = 0, $size = 'thumbnail', $permalink = false, $icon = false, $text = false, $attr = '' ) {
- $_post = get_post( $id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function wp_get_attachment_link( $post = 0, $size = 'thumbnail', $permalink = false, $icon = false, $text = false, $attr = '' ) {
+ $_post = get_post( $post );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $_post ) || ( 'attachment' !== $_post->post_type ) || ! wp_get_attachment_url( $_post->ID ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return __( 'Missing Attachment' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1641,6 +1643,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( '' === trim( $link_text ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $link_text = esc_html( pathinfo( get_attached_file( $_post->ID ), PATHINFO_FILENAME ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ $link_html = "<a href='" . esc_url( $url ) . "'>$link_text</a>";
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filters a retrieved attachment page link.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1648,7 +1653,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 5.1.0 Added the `$attr` parameter.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $link_html The page link HTML output.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|WP_Post $id Post ID or object. Can be 0 for the current global post.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $post Post ID or object. Can be 0 for the current global post.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string|int[] $size Requested image size. Can be any registered image size name, or
</span><span class="cx" style="display: block; padding: 0 10px"> * an array of width and height values in pixels (in that order).
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $permalink Whether to add permalink to image. Default false.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1656,7 +1661,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string|false $text If string, will be link text.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array|string $attr Array or string of attributes.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return apply_filters( 'wp_get_attachment_link', "<a href='" . esc_url( $url ) . "'>$link_text</a>", $id, $size, $permalink, $icon, $text, $attr );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return apply_filters( 'wp_get_attachment_link', $link_html, $post, $size, $permalink, $icon, $text, $attr );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1825,6 +1830,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_post_revision_title( $revision, $link = true ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $revision = get_post( $revision );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $revision ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $revision;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1866,6 +1872,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_post_revision_title_expanded( $revision, $link = true ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $revision = get_post( $revision );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $revision ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $revision;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1927,11 +1934,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.6.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|WP_Post $post_id Optional. Post ID or WP_Post object. Default is global $post.
- * @param string $type 'all' (default), 'revision' or 'autosave'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post.
+ * @param string $type 'all' (default), 'revision' or 'autosave'
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function wp_list_post_revisions( $post_id = 0, $type = 'all' ) {
- $post = get_post( $post_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function wp_list_post_revisions( $post = 0, $type = 'all' ) {
+ $post = get_post( $post );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1943,6 +1951,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $revisions = wp_get_post_revisions( $post->ID );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $revisions ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludespostphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/post.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/post.php 2022-07-17 02:16:27 UTC (rev 53714)
+++ trunk/src/wp-includes/post.php 2022-07-18 17:35:51 UTC (rev 53715)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1144,6 +1144,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( 'trash' === get_post_status( $post->post_parent ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Get parent status prior to trashing.
</span><span class="cx" style="display: block; padding: 0 10px"> $post_status = get_post_meta( $post->post_parent, '_wp_trash_meta_status', true );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post_status ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Assume publish as above.
</span><span class="cx" style="display: block; padding: 0 10px"> $post_status = 'publish';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2243,6 +2244,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function is_post_type_viewable( $post_type ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_scalar( $post_type ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $post_type = get_post_type_object( $post_type );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post_type ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2286,6 +2288,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function is_post_status_viewable( $post_status ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_scalar( $post_status ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $post_status = get_post_status_object( $post_status );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post_status ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2579,6 +2582,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function get_post_custom( $post_id = 0 ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = absint( $post_id );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post_id ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = get_the_ID();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4189,6 +4193,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * if none are provided, the date will be set to now.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $post_date = wp_resolve_post_date( $postarr['post_date'], $postarr['post_date_gmt'] );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post_date ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $wp_error ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return new WP_Error( 'invalid_date', __( 'Invalid date.' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4862,10 +4867,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|WP_Post $post_id Post ID or post object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $post Post ID or post object.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function check_and_publish_future_post( $post_id ) {
- $post = get_post( $post_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function check_and_publish_future_post( $post ) {
+ $post = get_post( $post );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4879,13 +4884,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Uh oh, someone jumped the gun!
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $time > time() ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_clear_scheduled_hook( 'publish_future_post', array( $post_id ) ); // Clear anything else in the system.
- wp_schedule_single_event( $time, 'publish_future_post', array( $post_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_clear_scheduled_hook( 'publish_future_post', array( $post->ID ) ); // Clear anything else in the system.
+ wp_schedule_single_event( $time, 'publish_future_post', array( $post->ID ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // wp_publish_post() returns no meaningful value.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_publish_post( $post_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_publish_post( $post->ID );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5375,6 +5380,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_after_insert_post( $post, $update, $post_before ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5403,19 +5409,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Adds a URL to those already pinged.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.5.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @since 4.7.0 `$post_id` can be a WP_Post object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 4.7.0 `$post` can be a WP_Post object.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @since 4.7.0 `$uri` can be an array of URIs.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @global wpdb $wpdb WordPress database abstraction object.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|WP_Post $post_id Post object or ID.
- * @param string|array $uri Ping URI or array of URIs.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $post Post ID or post object.
+ * @param string|array $uri Ping URI or array of URIs.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return int|false How many rows were updated.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function add_ping( $post_id, $uri ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function add_ping( $post, $uri ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> global $wpdb;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $post = get_post( $post_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post = get_post( $post );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5486,13 +5492,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @since 4.7.0 `$post_id` can be a WP_Post object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 4.7.0 `$post` can be a WP_Post object.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|WP_Post $post_id Post ID or object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $post Post ID or object.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return string[]|false Array of URLs already pinged for the given post, false if the post is not found.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function get_pung( $post_id ) {
- $post = get_post( $post_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function get_pung( $post ) {
+ $post = get_post( $post );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5515,13 +5521,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Retrieves URLs that need to be pinged.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.5.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @since 4.7.0 `$post_id` can be a WP_Post object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 4.7.0 `$post` can be a WP_Post object.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|WP_Post $post_id Post Object or ID
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $post Post ID or post object.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return string[]|false List of URLs yet to ping.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function get_to_ping( $post_id ) {
- $post = get_post( $post_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function get_to_ping( $post ) {
+ $post = get_post( $post );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7078,6 +7084,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post_type_clauses = array();
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $post_types as $post_type ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $post_type_obj = get_post_type_object( $post_type );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post_type_obj ) {
</span><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7092,6 +7099,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $cap Capability.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $cap = apply_filters_deprecated( 'pub_priv_sql_capability', array( '' ), '3.2.0' );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $cap ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $cap = current_user_can( $post_type_obj->cap->read_private_posts );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7098,6 +7106,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Only need to check the cap if $public_only is false.
</span><span class="cx" style="display: block; padding: 0 10px"> $post_status_sql = "post_status = 'publish'";
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( false === $public_only ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $cap ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Does the user have the capability to view private posts? Guess so.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7639,9 +7648,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_get_post_parent_id( $post = null ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post || is_wp_error( $post ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> return (int) $post->post_parent;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpincludesrevisionphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/revision.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/revision.php 2022-07-17 02:16:27 UTC (rev 53714)
+++ trunk/src/wp-includes/revision.php 2022-07-18 17:35:51 UTC (rev 53715)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -112,6 +112,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post_id );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -275,6 +276,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_is_post_revision( $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $post = wp_get_post_revision( $post );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -292,6 +294,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_is_post_autosave( $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $post = wp_get_post_revision( $post );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -355,7 +358,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.6.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|WP_Post $post The post ID or object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $post Post ID or post object.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which
</span><span class="cx" style="display: block; padding: 0 10px"> * correspond to a WP_Post object, an associative array, or a numeric array,
</span><span class="cx" style="display: block; padding: 0 10px"> * respectively. Default OBJECT.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -364,9 +367,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_get_post_revision( &$post, $output = OBJECT, $filter = 'raw' ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $revision = get_post( $post, OBJECT, $filter );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $revision ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $revision;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( 'revision' !== $revision->post_type ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return null;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -391,12 +396,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.6.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|WP_Post $revision_id Revision ID or revision object.
- * @param array $fields Optional. What fields to restore from. Defaults to all.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $revision Revision ID or revision object.
+ * @param array $fields Optional. What fields to restore from. Defaults to all.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return int|false|null Null if error, false if no fields to restore, (int) post ID if success.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function wp_restore_post_revision( $revision_id, $fields = null ) {
- $revision = wp_get_post_revision( $revision_id, ARRAY_A );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function wp_restore_post_revision( $revision, $fields = null ) {
+ $revision = wp_get_post_revision( $revision, ARRAY_A );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $revision ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $revision;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -419,6 +425,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $update = wp_slash( $update ); // Since data is from DB.
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = wp_update_post( $update );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post_id || is_wp_error( $post_id ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $post_id;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -446,16 +453,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.6.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|WP_Post $revision_id Revision ID or revision object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $revision Revision ID or revision object.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return WP_Post|false|null Null or false if error, deleted post object if success.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function wp_delete_post_revision( $revision_id ) {
- $revision = wp_get_post_revision( $revision_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function wp_delete_post_revision( $revision ) {
+ $revision = wp_get_post_revision( $revision );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $revision ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $revision;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $delete = wp_delete_post( $revision->ID );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $delete ) {
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Fires once a post revision has been deleted.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -478,12 +487,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see get_children()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|WP_Post $post_id Optional. Post ID or WP_Post object. Default is global `$post`.
- * @param array|null $args Optional. Arguments for retrieving post revisions. Default null.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`.
+ * @param array|null $args Optional. Arguments for retrieving post revisions. Default null.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return array An array of revisions, or an empty array if none.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function wp_get_post_revisions( $post_id = 0, $args = null ) {
- $post = get_post( $post_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function wp_get_post_revisions( $post = 0, $args = null ) {
+ $post = get_post( $post );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post || empty( $post->ID ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return array();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -509,6 +519,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $revisions = get_children( $args );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $revisions ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return array();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -521,11 +532,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 5.9.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|WP_Post $post_id Optional. Post ID or WP_Post object. Default is global `$post`.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return null|string The URL for editing revisions on the given post, otherwise null.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function wp_get_post_revisions_url( $post_id = 0 ) {
- $post = get_post( $post_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function wp_get_post_revisions_url( $post = 0 ) {
+ $post = get_post( $post );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post instanceof WP_Post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return null;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -684,6 +695,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function _wp_preview_terms_filter( $terms, $post_id, $taxonomy ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post();
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $terms;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -719,6 +731,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function _wp_preview_post_thumbnail_filter( $value, $post_id, $meta_key ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post();
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $value;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -734,6 +747,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $thumbnail_id = (int) $_REQUEST['_thumbnail_id'];
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $thumbnail_id <= 0 ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return '';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -783,9 +797,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $lock = "revision-upgrade-{$post->ID}";
</span><span class="cx" style="display: block; padding: 0 10px"> $now = time();
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $wpdb->query( $wpdb->prepare( "INSERT IGNORE INTO `$wpdb->options` (`option_name`, `option_value`, `autoload`) VALUES (%s, %s, 'no') /* LOCK */", $lock, $now ) );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $result ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // If we couldn't get a lock, see how old the previous lock is.
</span><span class="cx" style="display: block; padding: 0 10px"> $locked = get_option( $lock );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $locked ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Can't write to the lock, and can't read the lock.
</span><span class="cx" style="display: block; padding: 0 10px"> // Something broken has happened.
</span></span></pre>
</div>
</div>
</body>
</html>