<!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>[55365] trunk: Coding Standards: Rename `$post_ID` variable to `$post_id` in various files.</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/55365">55365</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/55365","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>2023-02-19 15:03:50 +0000 (Sun, 19 Feb 2023)</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'>Coding Standards: Rename `$post_ID` variable to `$post_id` in various files.
The `$post_ID` variable is [https://github.com/WordPress/WordPress-Coding-Standards/blob/546f59c67854589bb8f6b49a30e642e75ff419ad/WordPress/Sniffs/NamingConventions/ValidVariableNameSniff.php#L54 technically allowed in WPCS], as there is a global of the same name that needs to remain for backward compatibility. However, this name is mostly a remnant of legacy code, and switching to `$post_id` where appropriate brings more consistency with the rest of core.
Additionally, this commit resolves a few WPCS warnings in core:
{{{
Variable "$post_IDs" is not in valid snake_case format
}}}
This affects:
* Function parameters in:
* `add_meta()`
* `post_preview()`
* `WP_Embed::delete_oembed_caches()`
* `WP_Embed::cache_oembed()`
* `wp_get_post_cats()`
* `wp_set_post_cats()`
* `wp_unique_post_slug()`
* `wp_set_post_categories()`
* `wp_check_post_hierarchy_for_loops()`
* `wp_add_trashed_suffix_to_post_name_for_trashed_posts()`
* `wp_filter_wp_template_unique_post_slug()`
* `wp_xmlrpc_server::add_enclosure_if_new()`
* `wp_xmlrpc_server::attach_uploads()`
* `wp_xmlrpc_server::mt_getTrackbackPings()`
* Internal variables in:
* `wp_ajax_inline_save()`
* `wp_ajax_set_post_thumbnail()`
* `wp_ajax_get_post_thumbnail_html()`
* `edit_post()`
* `bulk_edit_posts()`
* `wp_write_post()`
* `WP_Embed::shortcode()`
* `wp_insert_post()`
* `wp_xmlrpc_server::_insert_post()`
* `wp_xmlrpc_server::blogger_getPost()`
* `wp_xmlrpc_server::blogger_newPost()`
* `wp_xmlrpc_server::blogger_editPost()`
* `wp_xmlrpc_server::blogger_deletePost()`
* `wp_xmlrpc_server::mw_getPost()`
* `wp_xmlrpc_server::mw_newPost()`
* `wp_xmlrpc_server::mw_editPost()`
* `wp_xmlrpc_server::mt_getPostCategories()`
* `wp_xmlrpc_server::mt_setPostCategories()`
* `wp_xmlrpc_server::mt_publishPost()`
* `wp_xmlrpc_server::pingback_ping()`
* Hook parameters in:
* `oembed_ttl`
* `embed_oembed_html`
* `wp_insert_post_parent`
* `add_trashed_suffix_to_trashed_posts`
* `pre_post_update`
* `edit_attachment`
* `attachment_updated`
* `add_attachment`
* `edit_post_{$post->post_type}`
* `edit_post`
* `post_updated`
* `save_post_{$post->post_type}`
* `save_post`
* `wp_insert_post`
* `pre_wp_unique_post_slug`
* `wp_unique_post_slug`
* `xmlrpc_call_success_blogger_newPost`
* `xmlrpc_call_success_blogger_editPost`
* `xmlrpc_call_success_blogger_deletePost`
* `xmlrpc_call_success_mw_newPost`
* `xmlrpc_call_success_mw_editPost`
Note: The name change only affects variable names and DocBlocks.
The change does not affect the `$post_ID` global still used in a few places.
Follow-up to <a href="https://core.trac.wordpress.org/changeset/51399">[51399]</a>, <a href="https://core.trac.wordpress.org/changeset/52958">[52958]</a>, <a href="https://core.trac.wordpress.org/changeset/53723">[53723]</a>, <a href="https://core.trac.wordpress.org/changeset/53729">[53729]</a>, <a href="https://core.trac.wordpress.org/changeset/55190">[55190]</a>, <a href="https://core.trac.wordpress.org/changeset/55308">[55308]</a>, <a href="https://core.trac.wordpress.org/changeset/55334">[55334]</a>.
Props mahekkalola, tanjimtc71, SergeyBiryukov.
Fixes <a href="https://core.trac.wordpress.org/ticket/57692">#57692</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminincludesajaxactionsphp">trunk/src/wp-admin/includes/ajax-actions.php</a></li>
<li><a href="#trunksrcwpadminincludespostphp">trunk/src/wp-admin/includes/post.php</a></li>
<li><a href="#trunksrcwpincludesclasswpembedphp">trunk/src/wp-includes/class-wp-embed.php</a></li>
<li><a href="#trunksrcwpincludesclasswpxmlrpcserverphp">trunk/src/wp-includes/class-wp-xmlrpc-server.php</a></li>
<li><a href="#trunksrcwpincludesdeprecatedphp">trunk/src/wp-includes/deprecated.php</a></li>
<li><a href="#trunksrcwpincludespostphp">trunk/src/wp-includes/post.php</a></li>
<li><a href="#trunksrcwpincludesthemetemplatesphp">trunk/src/wp-includes/theme-templates.php</a></li>
<li><a href="#trunktestsphpunittestspostphp">trunk/tests/phpunit/tests/post.php</a></li>
<li><a href="#trunktestsphpunitteststermisObjectInTermphp">trunk/tests/phpunit/tests/term/isObjectInTerm.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminincludesajaxactionsphp"></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/ajax-actions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/ajax-actions.php 2023-02-18 15:07:12 UTC (rev 55364)
+++ trunk/src/wp-admin/includes/ajax-actions.php 2023-02-19 15:03:50 UTC (rev 55365)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2034,19 +2034,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_die();
</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_ID = (int) $_POST['post_ID'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_id = (int) $_POST['post_ID'];
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'page' === $_POST['post_type'] ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! current_user_can( 'edit_page', $post_ID ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! current_user_can( 'edit_page', $post_id ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> wp_die( __( 'Sorry, you are not allowed to edit this page.' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! current_user_can( 'edit_post', $post_ID ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! current_user_can( 'edit_post', $post_id ) ) {
</ins><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 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">- $last = wp_check_post_lock( $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $last = wp_check_post_lock( $post_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $last ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $last_user = get_userdata( $last );
</span><span class="cx" style="display: block; padding: 0 10px"> $last_user_name = $last_user ? $last_user->display_name : __( 'Someone' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2065,7 +2065,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = &$_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">- $post = get_post( $post_ID, ARRAY_A );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post = get_post( $post_id, ARRAY_A );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Since it's coming from the database.
</span><span class="cx" style="display: block; padding: 0 10px"> $post = wp_slash( $post );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2699,8 +2699,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_ajax_set_post_thumbnail() {
</span><span class="cx" style="display: block; padding: 0 10px"> $json = ! empty( $_REQUEST['json'] ); // New-style request.
</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_ID = (int) $_POST['post_id'];
- if ( ! current_user_can( 'edit_post', $post_ID ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_id = (int) $_POST['post_id'];
+ if ( ! current_user_can( 'edit_post', $post_id ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> wp_die( -1 );
</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">@@ -2707,14 +2707,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $thumbnail_id = (int) $_POST['thumbnail_id'];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $json ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- check_ajax_referer( "update-post_$post_ID" );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ check_ajax_referer( "update-post_$post_id" );
</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">- check_ajax_referer( "set_post_thumbnail-$post_ID" );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ check_ajax_referer( "set_post_thumbnail-$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"> if ( '-1' == $thumbnail_id ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( delete_post_thumbnail( $post_ID ) ) {
- $return = _wp_post_thumbnail_html( null, $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( delete_post_thumbnail( $post_id ) ) {
+ $return = _wp_post_thumbnail_html( null, $post_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> $json ? wp_send_json_success( $return ) : wp_die( $return );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_die( 0 );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2721,8 +2721,8 @@
</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">- if ( set_post_thumbnail( $post_ID, $thumbnail_id ) ) {
- $return = _wp_post_thumbnail_html( $thumbnail_id, $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( set_post_thumbnail( $post_id, $thumbnail_id ) ) {
+ $return = _wp_post_thumbnail_html( $thumbnail_id, $post_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> $json ? wp_send_json_success( $return ) : wp_die( $return );
</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">@@ -2735,11 +2735,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.6.0
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_ajax_get_post_thumbnail_html() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $post_ID = (int) $_POST['post_id'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_id = (int) $_POST['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">- check_ajax_referer( "update-post_$post_ID" );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ check_ajax_referer( "update-post_$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">- if ( ! current_user_can( 'edit_post', $post_ID ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! current_user_can( 'edit_post', $post_id ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> wp_die( -1 );
</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">@@ -2750,7 +2750,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $thumbnail_id = null;
</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">- $return = _wp_post_thumbnail_html( $thumbnail_id, $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $return = _wp_post_thumbnail_html( $thumbnail_id, $post_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> wp_send_json_success( $return );
</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="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 2023-02-18 15:07:12 UTC (rev 55364)
+++ trunk/src/wp-admin/includes/post.php 2023-02-19 15:03:50 UTC (rev 55365)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -252,8 +252,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Clear out any data in internal vars.
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $post_data['filter'] );
</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_ID = (int) $post_data['post_ID'];
- $post = get_post( $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_id = (int) $post_data['post_ID'];
+ $post = get_post( $post_id );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post_data['post_type'] = $post->post_type;
</span><span class="cx" style="display: block; padding: 0 10px"> $post_data['post_mime_type'] = $post->post_mime_type;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -267,7 +267,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"> $ptype = get_post_type_object( $post_data['post_type'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! current_user_can( 'edit_post', $post_ID ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! current_user_can( 'edit_post', $post_id ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( 'page' === $post_data['post_type'] ) {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_die( __( 'Sorry, you are not allowed to edit this page.' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -277,7 +277,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( post_type_supports( $ptype->name, 'revisions' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $revisions = wp_get_post_revisions(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $post_ID,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_id,
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'order' => 'ASC',
</span><span class="cx" style="display: block; padding: 0 10px"> 'posts_per_page' => 1,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -287,7 +287,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check if the revisions have been upgraded.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $revisions && _wp_get_post_revision_version( $revision ) < 1 ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- _wp_upgrade_revisions_of_post( $post, wp_get_post_revisions( $post_ID ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ _wp_upgrade_revisions_of_post( $post, wp_get_post_revisions( $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">@@ -315,7 +315,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Post formats.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $post_data['post_format'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- set_post_format( $post_ID, $post_data['post_format'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ set_post_format( $post_id, $post_data['post_format'] );
</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"> $format_meta_urls = array( 'url', 'link_url', 'quote_source_url' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -322,7 +322,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $format_meta_urls as $format_meta_url ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $keyed = '_format_' . $format_meta_url;
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $post_data[ $keyed ] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- update_post_meta( $post_ID, $keyed, wp_slash( sanitize_url( wp_unslash( $post_data[ $keyed ] ) ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ update_post_meta( $post_id, $keyed, wp_slash( sanitize_url( wp_unslash( $post_data[ $keyed ] ) ) ) );
</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">@@ -332,15 +332,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $keyed = '_format_' . $key;
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $post_data[ $keyed ] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( current_user_can( 'unfiltered_html' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- update_post_meta( $post_ID, $keyed, $post_data[ $keyed ] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ update_post_meta( $post_id, $keyed, $post_data[ $keyed ] );
</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">- update_post_meta( $post_ID, $keyed, wp_filter_post_kses( $post_data[ $keyed ] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ update_post_meta( $post_id, $keyed, wp_filter_post_kses( $post_data[ $keyed ] ) );
</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="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'attachment' === $post_data['post_type'] && preg_match( '#^(audio|video)/#', $post_data['post_mime_type'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $id3data = wp_get_attachment_metadata( $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $id3data = wp_get_attachment_metadata( $post_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! is_array( $id3data ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $id3data = array();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -350,7 +350,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $id3data[ $key ] = sanitize_text_field( wp_unslash( $post_data[ 'id3_' . $key ] ) );
</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">- wp_update_attachment_metadata( $post_ID, $id3data );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_update_attachment_metadata( $post_id, $id3data );
</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"> // Meta stuff.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -360,15 +360,23 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $meta ) {
</span><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $meta->post_id != $post_ID ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ if ( $meta->post_id != $post_id ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( is_protected_meta( $meta->meta_key, 'post' ) || ! current_user_can( 'edit_post_meta', $post_ID, $meta->meta_key ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ if ( is_protected_meta( $meta->meta_key, 'post' )
+ || ! current_user_can( 'edit_post_meta', $post_id, $meta->meta_key )
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( is_protected_meta( $value['key'], 'post' ) || ! current_user_can( 'edit_post_meta', $post_ID, $value['key'] ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ if ( is_protected_meta( $value['key'], 'post' )
+ || ! current_user_can( 'edit_post_meta', $post_id, $value['key'] )
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</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"> update_meta( $key, $value['key'], $value['value'] );
</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">@@ -379,12 +387,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $meta ) {
</span><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $meta->post_id != $post_ID ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ if ( $meta->post_id != $post_id ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( is_protected_meta( $meta->meta_key, 'post' ) || ! current_user_can( 'delete_post_meta', $post_ID, $meta->meta_key ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ if ( is_protected_meta( $meta->meta_key, 'post' )
+ || ! current_user_can( 'delete_post_meta', $post_id, $meta->meta_key )
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</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"> delete_meta( $key );
</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">@@ -394,15 +407,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $post_data['_wp_attachment_image_alt'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $image_alt = wp_unslash( $post_data['_wp_attachment_image_alt'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( get_post_meta( $post_ID, '_wp_attachment_image_alt', true ) !== $image_alt ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( get_post_meta( $post_id, '_wp_attachment_image_alt', true ) !== $image_alt ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $image_alt = wp_strip_all_tags( $image_alt, true );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // update_post_meta() expects slashed.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- update_post_meta( $post_ID, '_wp_attachment_image_alt', wp_slash( $image_alt ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ update_post_meta( $post_id, '_wp_attachment_image_alt', wp_slash( $image_alt ) );
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $attachment_data = isset( $post_data['attachments'][ $post_ID ] ) ? $post_data['attachments'][ $post_ID ] : array();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $attachment_data = isset( $post_data['attachments'][ $post_id ] ) ? $post_data['attachments'][ $post_id ] : array();
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /** This filter is documented in wp-admin/includes/media.php */
</span><span class="cx" style="display: block; padding: 0 10px"> $translated = apply_filters( 'attachment_fields_to_save', $translated, $attachment_data );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -419,9 +432,9 @@
</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">- add_meta( $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ add_meta( $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">- update_post_meta( $post_ID, '_edit_last', get_current_user_id() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ update_post_meta( $post_id, '_edit_last', get_current_user_id() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $success = wp_update_post( $translated );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -439,19 +452,19 @@
</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"> // Now that we have an ID we can fix any attachment anchor hrefs.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- _fix_attachment_links( $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ _fix_attachment_links( $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">- wp_set_post_lock( $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_set_post_lock( $post_id );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( current_user_can( $ptype->cap->edit_others_posts ) && current_user_can( $ptype->cap->publish_posts ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $post_data['sticky'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- stick_post( $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ stick_post( $post_id );
</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">- unstick_post( $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ unstick_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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $post_ID;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $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">@@ -505,7 +518,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">- $post_IDs = array_map( 'intval', (array) $post_data['post'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_ids = array_map( 'intval', (array) $post_data['post'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $reset = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_author',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -542,6 +555,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $terms ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> continue;
</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 ( is_taxonomy_hierarchical( $tax_name ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $tax_input[ $tax_name ] = array_map( 'absint', $terms );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -576,26 +590,26 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $locked = array();
</span><span class="cx" style="display: block; padding: 0 10px"> $shared_post_data = $post_data;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- foreach ( $post_IDs as $post_ID ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ foreach ( $post_ids as $post_id ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> // Start with fresh post data with each iteration.
</span><span class="cx" style="display: block; padding: 0 10px"> $post_data = $shared_post_data;
</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_type_object = get_post_type_object( get_post_type( $post_ID ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_type_object = get_post_type_object( get_post_type( $post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! isset( $post_type_object )
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- || ( isset( $children ) && in_array( $post_ID, $children, true ) )
- || ! current_user_can( 'edit_post', $post_ID )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ || ( isset( $children ) && in_array( $post_id, $children, true ) )
+ || ! current_user_can( 'edit_post', $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">- $skipped[] = $post_ID;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $skipped[] = $post_id;
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</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">- if ( wp_check_post_lock( $post_ID ) ) {
- $locked[] = $post_ID;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( wp_check_post_lock( $post_id ) ) {
+ $locked[] = $post_id;
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</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( $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post = get_post( $post_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> $tax_names = get_object_taxonomies( $post );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $tax_names as $tax_name ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -612,9 +626,9 @@
</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 ( $taxonomy_obj->hierarchical ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $current_terms = (array) wp_get_object_terms( $post_ID, $tax_name, array( 'fields' => 'ids' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $current_terms = (array) wp_get_object_terms( $post_id, $tax_name, array( 'fields' => 'ids' ) );
</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">- $current_terms = (array) wp_get_object_terms( $post_ID, $tax_name, array( 'fields' => 'names' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $current_terms = (array) wp_get_object_terms( $post_id, $tax_name, array( 'fields' => 'names' ) );
</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"> $post_data['tax_input'][ $tax_name ] = array_merge( $current_terms, $new_terms );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -621,12 +635,12 @@
</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 ( isset( $new_cats ) && in_array( 'category', $tax_names, true ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $cats = (array) wp_get_post_categories( $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $cats = (array) wp_get_post_categories( $post_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> $post_data['post_category'] = array_unique( array_merge( $cats, $new_cats ) );
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $post_data['tax_input']['category'] );
</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_data['post_ID'] = $post_ID;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_data['post_ID'] = $post_id;
</ins><span class="cx" style="display: block; padding: 0 10px"> $post_data['post_type'] = $post->post_type;
</span><span class="cx" style="display: block; padding: 0 10px"> $post_data['post_mime_type'] = $post->post_mime_type;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -638,13 +652,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post_data = _wp_translate_postdata( true, $post_data );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_wp_error( $post_data ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $skipped[] = $post_ID;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $skipped[] = $post_id;
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $post_data = _wp_get_allowed_postdata( $post_data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $shared_post_data['post_format'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- set_post_format( $post_ID, $shared_post_data['post_format'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ set_post_format( $post_id, $shared_post_data['post_format'] );
</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"> // Prevent wp_insert_post() from overwriting post format with the old data.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -656,9 +670,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $post_data['sticky'] ) && current_user_can( $ptype->cap->edit_others_posts ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'sticky' === $post_data['sticky'] ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- stick_post( $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ stick_post( $post_id );
</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">- unstick_post( $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ unstick_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">@@ -887,25 +901,25 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $translated = _wp_get_allowed_postdata( $translated );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Create the post.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $post_ID = wp_insert_post( $translated );
- if ( is_wp_error( $post_ID ) ) {
- return $post_ID;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_id = wp_insert_post( $translated );
+ if ( is_wp_error( $post_id ) ) {
+ return $post_id;
</ins><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">- if ( empty( $post_ID ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( empty( $post_id ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return 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">- add_meta( $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ add_meta( $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">- add_post_meta( $post_ID, '_edit_last', $GLOBALS['current_user']->ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ add_post_meta( $post_id, '_edit_last', $GLOBALS['current_user']->ID );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Now that we have an ID we can fix any attachment anchor hrefs.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- _fix_attachment_links( $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ _fix_attachment_links( $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">- wp_set_post_lock( $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_set_post_lock( $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 $post_ID;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $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">@@ -933,11 +947,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int $post_ID
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $post_id
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return int|bool
</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_meta( $post_ID ) {
- $post_ID = (int) $post_ID;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function add_meta( $post_id ) {
+ $post_id = (int) $post_id;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $metakeyselect = isset( $_POST['metakeyselect'] ) ? wp_unslash( trim( $_POST['metakeyselect'] ) ) : '';
</span><span class="cx" style="display: block; padding: 0 10px"> $metakeyinput = isset( $_POST['metakeyinput'] ) ? wp_unslash( trim( $_POST['metakeyinput'] ) ) : '';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -959,13 +973,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $metakey = $metakeyinput; // Default.
</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">- if ( is_protected_meta( $metakey, 'post' ) || ! current_user_can( 'add_post_meta', $post_ID, $metakey ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( is_protected_meta( $metakey, 'post' ) || ! current_user_can( 'add_post_meta', $post_id, $metakey ) ) {
</ins><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"> $metakey = wp_slash( $metakey );
</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 add_post_meta( $post_ID, $metakey, $metavalue );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return add_post_meta( $post_id, $metakey, $metavalue );
</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"> return false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1941,10 +1955,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function post_preview() {
</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_ID = (int) $_POST['post_ID'];
- $_POST['ID'] = $post_ID;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_id = (int) $_POST['post_ID'];
+ $_POST['ID'] = $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">- $post = get_post( $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post = get_post( $post_id );
</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"> wp_die( __( 'Sorry, you are not allowed to edit this post.' ) );
</span></span></pre></div>
<a id="trunksrcwpincludesclasswpembedphp"></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/class-wp-embed.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-embed.php 2023-02-18 15:07:12 UTC (rev 55364)
+++ trunk/src/wp-includes/class-wp-embed.php 2023-02-19 15:03:50 UTC (rev 55365)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -222,11 +222,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $embed_handler_html;
</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_ID = ( ! empty( $post->ID ) ) ? $post->ID : null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_id = ( ! empty( $post->ID ) ) ? $post->ID : null;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Potentially set by WP_Embed::cache_oembed().
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $this->post_ID ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $post_ID = $this->post_ID;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_id = $this->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"> // Check for a cached result (stored as custom post or in the post meta).
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -242,9 +242,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $time Time to live (in seconds).
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $url The attempted embed URL.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $attr An array of shortcode attributes.
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $ttl = apply_filters( 'oembed_ttl', DAY_IN_SECONDS, $url, $attr, $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $ttl = apply_filters( 'oembed_ttl', DAY_IN_SECONDS, $url, $attr, $post_id );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $cache = '';
</span><span class="cx" style="display: block; padding: 0 10px"> $cache_time = 0;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -251,9 +251,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $cached_post_id = $this->find_oembed_post_id( $key_suffix );
</span><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_ID ) {
- $cache = get_post_meta( $post_ID, $cachekey, true );
- $cache_time = get_post_meta( $post_ID, $cachekey_time, true );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $post_id ) {
+ $cache = get_post_meta( $post_id, $cachekey, true );
+ $cache_time = get_post_meta( $post_id, $cachekey_time, true );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $cache_time ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $cache_time = 0;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -284,9 +284,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string|false $cache The cached HTML result, stored in post meta.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $url The attempted embed URL.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $attr An array of shortcode attributes.
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return apply_filters( 'embed_oembed_html', $cache, $url, $attr, $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return apply_filters( 'embed_oembed_html', $cache, $url, $attr, $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">@@ -305,12 +305,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Use oEmbed to get the HTML.
</span><span class="cx" style="display: block; padding: 0 10px"> $html = wp_oembed_get( $url, $attr );
</span><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_ID ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $post_id ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $html ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- update_post_meta( $post_ID, $cachekey, $html );
- update_post_meta( $post_ID, $cachekey_time, time() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ update_post_meta( $post_id, $cachekey, $html );
+ update_post_meta( $post_id, $cachekey_time, time() );
</ins><span class="cx" style="display: block; padding: 0 10px"> } elseif ( ! $cache ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- update_post_meta( $post_ID, $cachekey, '{{unknown}}' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ update_post_meta( $post_id, $cachekey, '{{unknown}}' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $has_kses = false !== has_filter( 'content_save_pre', 'wp_filter_post_kses' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -369,7 +369,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // If there was a result, return it.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $html ) {
</span><span class="cx" style="display: block; padding: 0 10px"> /** This filter is documented in wp-includes/class-wp-embed.php */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return apply_filters( 'embed_oembed_html', $html, $url, $attr, $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return apply_filters( 'embed_oembed_html', $html, $url, $attr, $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"> // Still unknown.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -379,10 +379,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Deletes all oEmbed caches. Unused by core as of 4.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 $post_ID Post ID to delete the caches for.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $post_id Post ID to delete the caches for.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function delete_oembed_caches( $post_ID ) {
- $post_metas = get_post_custom_keys( $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function delete_oembed_caches( $post_id ) {
+ $post_metas = get_post_custom_keys( $post_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $post_metas ) ) {
</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">@@ -389,7 +389,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $post_metas as $post_meta_key ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( '_oembed_' === substr( $post_meta_key, 0, 8 ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- delete_post_meta( $post_ID, $post_meta_key );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ delete_post_meta( $post_id, $post_meta_key );
</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">@@ -397,10 +397,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Triggers a caching of all oEmbed results.
</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 $post_ID Post ID to do the caching for.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $post_id Post ID to do the caching for.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function cache_oembed( $post_ID ) {
- $post = get_post( $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function cache_oembed( $post_id ) {
+ $post = get_post( $post_id );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post_types = get_post_types( array( 'show_ui' => true ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpincludesclasswpxmlrpcserverphp"></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/class-wp-xmlrpc-server.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-xmlrpc-server.php 2023-02-18 15:07:12 UTC (rev 55364)
+++ trunk/src/wp-includes/class-wp-xmlrpc-server.php 2023-02-19 15:03:50 UTC (rev 55365)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1529,7 +1529,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! isset( $post_data['ID'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $post_data['ID'] = get_default_post_to_edit( $post_data['post_type'], true )->ID;
</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_ID = $post_data['ID'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_id = $post_data['ID'];
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'post' === $post_data['post_type'] ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $error = $this->_toggle_sticky( $post_data, $update );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1541,16 +1541,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $post_data['post_thumbnail'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Empty value deletes, non-empty value adds/updates.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post_data['post_thumbnail'] ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- delete_post_thumbnail( $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ delete_post_thumbnail( $post_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> } elseif ( ! get_post( absint( $post_data['post_thumbnail'] ) ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return new IXR_Error( 404, __( 'Invalid attachment ID.' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- set_post_thumbnail( $post_ID, $post_data['post_thumbnail'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ set_post_thumbnail( $post_id, $post_data['post_thumbnail'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> unset( $content_struct['post_thumbnail'] );
</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 ( isset( $post_data['custom_fields'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->set_custom_fields( $post_ID, $post_data['custom_fields'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->set_custom_fields( $post_id, $post_data['custom_fields'] );
</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"> if ( isset( $post_data['terms'] ) || isset( $post_data['terms_names'] ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1656,7 +1656,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"> if ( isset( $post_data['post_format'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $format = set_post_format( $post_ID, $post_data['post_format'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $format = set_post_format( $post_id, $post_data['post_format'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_wp_error( $format ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return new IXR_Error( 500, $format->get_error_message() );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1667,9 +1667,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Handle enclosures.
</span><span class="cx" style="display: block; padding: 0 10px"> $enclosure = isset( $post_data['enclosure'] ) ? $post_data['enclosure'] : null;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->add_enclosure_if_new( $post_ID, $enclosure );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->add_enclosure_if_new( $post_id, $enclosure );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->attach_uploads( $post_ID, $post_data['post_content'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->attach_uploads( $post_id, $post_data['post_content'] );
</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 post data array to be inserted via XML-RPC.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1689,12 +1689,12 @@
</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">- $post_ID = $update ? wp_update_post( $post_data, true ) : wp_insert_post( $post_data, true );
- if ( is_wp_error( $post_ID ) ) {
- return new IXR_Error( 500, $post_ID->get_error_message() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_id = $update ? wp_update_post( $post_data, true ) : wp_insert_post( $post_data, true );
+ if ( is_wp_error( $post_id ) ) {
+ return new IXR_Error( 500, $post_id->get_error_message() );
</ins><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">- if ( ! $post_ID ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! $post_id ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $update ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return new IXR_Error( 401, __( 'Sorry, the post could not be updated.' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1702,7 +1702,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">- return (string) $post_ID;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return (string) $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">@@ -4942,7 +4942,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function blogger_getPost( $args ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->escape( $args );
</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_ID = (int) $args[1];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_id = (int) $args[1];
</ins><span class="cx" style="display: block; padding: 0 10px"> $username = $args[2];
</span><span class="cx" style="display: block; padding: 0 10px"> $password = $args[3];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4951,12 +4951,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->error;
</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_data = get_post( $post_ID, ARRAY_A );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_data = get_post( $post_id, ARRAY_A );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post_data ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return new IXR_Error( 404, __( 'Invalid post ID.' ) );
</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">- if ( ! current_user_can( 'edit_post', $post_ID ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! current_user_can( 'edit_post', $post_id ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) );
</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">@@ -4963,7 +4963,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( 'xmlrpc_call', 'blogger.getPost', $args, $this );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $categories = implode( ',', wp_get_post_categories( $post_ID ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $categories = implode( ',', wp_get_post_categories( $post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $content = '<title>' . wp_unslash( $post_data['post_title'] ) . '</title>';
</span><span class="cx" style="display: block; padding: 0 10px"> $content .= '<category>' . $categories . '</category>';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5128,16 +5128,16 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post_data = compact( 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status' );
</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_ID = wp_insert_post( $post_data );
- if ( is_wp_error( $post_ID ) ) {
- return new IXR_Error( 500, $post_ID->get_error_message() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_id = wp_insert_post( $post_data );
+ if ( is_wp_error( $post_id ) ) {
+ return new IXR_Error( 500, $post_id->get_error_message() );
</ins><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">- if ( ! $post_ID ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! $post_id ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return new IXR_Error( 500, __( 'Sorry, the post could not be created.' ) );
</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">- $this->attach_uploads( $post_ID, $post_content );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->attach_uploads( $post_id, $post_content );
</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"> * Fires after a new post has been successfully created via the XML-RPC Blogger API.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5144,12 +5144,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.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 int $post_ID ID of the new post.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $post_id ID of the new post.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param array $args An array of new post arguments.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- do_action( 'xmlrpc_call_success_blogger_newPost', $post_ID, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ do_action( 'xmlrpc_call_success_blogger_newPost', $post_id, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase
</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 $post_ID;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $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">@@ -5173,7 +5173,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->escape( $args );
</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_ID = (int) $args[1];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_id = (int) $args[1];
</ins><span class="cx" style="display: block; padding: 0 10px"> $username = $args[2];
</span><span class="cx" style="display: block; padding: 0 10px"> $password = $args[3];
</span><span class="cx" style="display: block; padding: 0 10px"> $content = $args[4];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5187,7 +5187,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( 'xmlrpc_call', 'blogger.editPost', $args, $this );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $actual_post = get_post( $post_ID, ARRAY_A );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $actual_post = get_post( $post_id, ARRAY_A );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $actual_post || 'post' !== $actual_post['post_type'] ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return new IXR_Error( 404, __( 'Sorry, no such post.' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5195,7 +5195,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->escape( $actual_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">- if ( ! current_user_can( 'edit_post', $post_ID ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! current_user_can( 'edit_post', $post_id ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'publish' === $actual_post['post_status'] && ! current_user_can( 'publish_posts' ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5223,10 +5223,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.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 int $post_ID ID of the updated post.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $post_id ID of the updated post.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param array $args An array of arguments for the post to edit.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- do_action( 'xmlrpc_call_success_blogger_editPost', $post_ID, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ do_action( 'xmlrpc_call_success_blogger_editPost', $post_id, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5249,7 +5249,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function blogger_deletePost( $args ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->escape( $args );
</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_ID = (int) $args[1];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_id = (int) $args[1];
</ins><span class="cx" style="display: block; padding: 0 10px"> $username = $args[2];
</span><span class="cx" style="display: block; padding: 0 10px"> $password = $args[3];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5261,17 +5261,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( 'xmlrpc_call', 'blogger.deletePost', $args, $this );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $actual_post = get_post( $post_ID, ARRAY_A );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $actual_post = get_post( $post_id, ARRAY_A );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $actual_post || 'post' !== $actual_post['post_type'] ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return new IXR_Error( 404, __( 'Sorry, no such post.' ) );
</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">- if ( ! current_user_can( 'delete_post', $post_ID ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! current_user_can( 'delete_post', $post_id ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return new IXR_Error( 401, __( 'Sorry, you are not allowed to delete this post.' ) );
</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">- $result = wp_delete_post( $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $result = wp_delete_post( $post_id );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $result ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return new IXR_Error( 500, __( 'Sorry, the post could not be deleted.' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5282,10 +5282,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.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 int $post_ID ID of the deleted post.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $post_id ID of the deleted post.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param array $args An array of arguments to delete the 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">- do_action( 'xmlrpc_call_success_blogger_deletePost', $post_ID, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ do_action( 'xmlrpc_call_success_blogger_deletePost', $post_id, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5580,8 +5580,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $postdata = compact( 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'to_ping', 'post_type', 'post_name', 'post_password', 'post_parent', 'menu_order', 'tags_input', 'page_template' );
</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_ID = get_default_post_to_edit( $post_type, true )->ID;
- $postdata['ID'] = $post_ID;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_id = get_default_post_to_edit( $post_type, true )->ID;
+ $postdata['ID'] = $post_id;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Only posts can be sticky.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'post' === $post_type && isset( $content_struct['sticky'] ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5594,11 +5594,11 @@
</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 ( isset( $content_struct['custom_fields'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->set_custom_fields( $post_ID, $content_struct['custom_fields'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->set_custom_fields( $post_id, $content_struct['custom_fields'] );
</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"> if ( isset( $content_struct['wp_post_thumbnail'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( set_post_thumbnail( $post_ID, $content_struct['wp_post_thumbnail'] ) === false ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( set_post_thumbnail( $post_id, $content_struct['wp_post_thumbnail'] ) === false ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return new IXR_Error( 404, __( 'Invalid attachment ID.' ) );
</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">@@ -5607,22 +5607,22 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Handle enclosures.
</span><span class="cx" style="display: block; padding: 0 10px"> $thisEnclosure = isset( $content_struct['enclosure'] ) ? $content_struct['enclosure'] : null;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->add_enclosure_if_new( $post_ID, $thisEnclosure );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->add_enclosure_if_new( $post_id, $thisEnclosure );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->attach_uploads( $post_ID, $post_content );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->attach_uploads( $post_id, $post_content );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Handle post formats if assigned, value is validated earlier
</span><span class="cx" style="display: block; padding: 0 10px"> // in this function.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $content_struct['wp_post_format'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- set_post_format( $post_ID, $content_struct['wp_post_format'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ set_post_format( $post_id, $content_struct['wp_post_format'] );
</ins><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_ID = wp_insert_post( $postdata, true );
- if ( is_wp_error( $post_ID ) ) {
- return new IXR_Error( 500, $post_ID->get_error_message() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_id = wp_insert_post( $postdata, true );
+ if ( is_wp_error( $post_id ) ) {
+ return new IXR_Error( 500, $post_id->get_error_message() );
</ins><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">- if ( ! $post_ID ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! $post_id ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return new IXR_Error( 500, __( 'Sorry, the post could not be created.' ) );
</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">@@ -5631,12 +5631,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.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 int $post_ID ID of the new post.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $post_id ID of the new post.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param array $args An array of arguments to create the new 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">- do_action( 'xmlrpc_call_success_mw_newPost', $post_ID, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ do_action( 'xmlrpc_call_success_mw_newPost', $post_id, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase
</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 (string) $post_ID;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return (string) $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">@@ -5644,14 +5644,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.8.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 $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"> * @param array $enclosure Enclosure data.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function add_enclosure_if_new( $post_ID, $enclosure ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function add_enclosure_if_new( $post_id, $enclosure ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( is_array( $enclosure ) && isset( $enclosure['url'] ) && isset( $enclosure['length'] ) && isset( $enclosure['type'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $encstring = $enclosure['url'] . "\n" . $enclosure['length'] . "\n" . $enclosure['type'] . "\n";
</span><span class="cx" style="display: block; padding: 0 10px"> $found = false;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $enclosures = get_post_meta( $post_ID, 'enclosure' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $enclosures = get_post_meta( $post_id, 'enclosure' );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $enclosures ) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $enclosures as $enc ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // This method used to omit the trailing new line. #23219
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5662,7 +5662,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"> if ( ! $found ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- add_post_meta( $post_ID, 'enclosure', $encstring );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ add_post_meta( $post_id, 'enclosure', $encstring );
</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">@@ -5674,10 +5674,10 @@
</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 $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"> * @param string $post_content Post Content for attachment.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function attach_uploads( $post_ID, $post_content ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function attach_uploads( $post_id, $post_content ) {
</ins><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"> // Find any unattached files.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5685,7 +5685,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_array( $attachments ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $attachments as $file ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $file->guid ) && strpos( $post_content, $file->guid ) !== false ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $wpdb->update( $wpdb->posts, array( 'post_parent' => $post_ID ), array( 'ID' => $file->ID ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $wpdb->update( $wpdb->posts, array( 'post_parent' => $post_id ), array( 'ID' => $file->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">@@ -5710,7 +5710,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function mw_editPost( $args ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->escape( $args );
</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_ID = (int) $args[0];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_id = (int) $args[0];
</ins><span class="cx" style="display: block; padding: 0 10px"> $username = $args[1];
</span><span class="cx" style="display: block; padding: 0 10px"> $password = $args[2];
</span><span class="cx" style="display: block; padding: 0 10px"> $content_struct = $args[3];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5724,7 +5724,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( 'xmlrpc_call', 'metaWeblog.editPost', $args, $this );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $postdata = get_post( $post_ID, ARRAY_A );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $postdata = get_post( $post_id, ARRAY_A );
</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"> * If there is no post data for the give post ID, stop now and return an error.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5734,7 +5734,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return new IXR_Error( 404, __( 'Invalid post ID.' ) );
</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">- if ( ! current_user_can( 'edit_post', $post_ID ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! current_user_can( 'edit_post', $post_id ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) );
</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">@@ -5983,7 +5983,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"> if ( isset( $content_struct['custom_fields'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->set_custom_fields( $post_ID, $content_struct['custom_fields'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->set_custom_fields( $post_id, $content_struct['custom_fields'] );
</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"> if ( isset( $content_struct['wp_post_thumbnail'] ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5990,9 +5990,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Empty value deletes, non-empty value adds/updates.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $content_struct['wp_post_thumbnail'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- delete_post_thumbnail( $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ delete_post_thumbnail( $post_id );
</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">- if ( set_post_thumbnail( $post_ID, $content_struct['wp_post_thumbnail'] ) === false ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( set_post_thumbnail( $post_id, $content_struct['wp_post_thumbnail'] ) === false ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return new IXR_Error( 404, __( 'Invalid attachment ID.' ) );
</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">@@ -6001,13 +6001,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Handle enclosures.
</span><span class="cx" style="display: block; padding: 0 10px"> $thisEnclosure = isset( $content_struct['enclosure'] ) ? $content_struct['enclosure'] : null;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->add_enclosure_if_new( $post_ID, $thisEnclosure );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->add_enclosure_if_new( $post_id, $thisEnclosure );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->attach_uploads( $ID, $post_content );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Handle post formats if assigned, validation is handled earlier in this function.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $content_struct['wp_post_format'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- set_post_format( $post_ID, $content_struct['wp_post_format'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ set_post_format( $post_id, $content_struct['wp_post_format'] );
</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">@@ -6015,10 +6015,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.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 int $post_ID ID of the updated post.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $post_id ID of the updated post.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param array $args An array of arguments to update the 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">- do_action( 'xmlrpc_call_success_mw_editPost', $post_ID, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ do_action( 'xmlrpc_call_success_mw_editPost', $post_id, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6040,7 +6040,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function mw_getPost( $args ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->escape( $args );
</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_ID = (int) $args[0];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_id = (int) $args[0];
</ins><span class="cx" style="display: block; padding: 0 10px"> $username = $args[1];
</span><span class="cx" style="display: block; padding: 0 10px"> $password = $args[2];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6049,12 +6049,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->error;
</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">- $postdata = get_post( $post_ID, ARRAY_A );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $postdata = get_post( $post_id, ARRAY_A );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $postdata ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return new IXR_Error( 404, __( 'Invalid post ID.' ) );
</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">- if ( ! current_user_can( 'edit_post', $post_ID ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! current_user_can( 'edit_post', $post_id ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) );
</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">@@ -6068,13 +6068,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post_modified_gmt = $this->_convert_date_gmt( $postdata['post_modified_gmt'], $postdata['post_modified'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $categories = array();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $catids = wp_get_post_categories( $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $catids = wp_get_post_categories( $post_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $catids as $catid ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $categories[] = get_cat_name( $catid );
</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"> $tagnames = array();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $tags = wp_get_post_tags( $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $tags = wp_get_post_tags( $post_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $tags ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $tags as $tag ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $tagnames[] = $tag->name;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6099,18 +6099,18 @@
</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"> // Get post format.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $post_format = get_post_format( $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_format = get_post_format( $post_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $post_format ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $post_format = 'standard';
</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"> $sticky = false;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( is_sticky( $post_ID ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( is_sticky( $post_id ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $sticky = true;
</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"> $enclosure = array();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- foreach ( (array) get_post_custom( $post_ID ) as $key => $val ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ foreach ( (array) get_post_custom( $post_id ) as $key => $val ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( 'enclosure' === $key ) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( (array) $val as $enc ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $encdata = explode( "\n", $enc );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6145,7 +6145,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'wp_author_display_name' => $author->display_name,
</span><span class="cx" style="display: block; padding: 0 10px"> 'date_created_gmt' => $post_date_gmt,
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_status' => $postdata['post_status'],
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'custom_fields' => $this->get_custom_fields( $post_ID ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'custom_fields' => $this->get_custom_fields( $post_id ),
</ins><span class="cx" style="display: block; padding: 0 10px"> 'wp_post_format' => $post_format,
</span><span class="cx" style="display: block; padding: 0 10px"> 'sticky' => $sticky,
</span><span class="cx" style="display: block; padding: 0 10px"> 'date_modified' => $post_modified,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6603,7 +6603,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function mt_getPostCategories( $args ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->escape( $args );
</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_ID = (int) $args[0];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_id = (int) $args[0];
</ins><span class="cx" style="display: block; padding: 0 10px"> $username = $args[1];
</span><span class="cx" style="display: block; padding: 0 10px"> $password = $args[2];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6612,11 +6612,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->error;
</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">- if ( ! get_post( $post_ID ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! get_post( $post_id ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return new IXR_Error( 404, __( 'Invalid post ID.' ) );
</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">- if ( ! current_user_can( 'edit_post', $post_ID ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! current_user_can( 'edit_post', $post_id ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) );
</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">@@ -6624,7 +6624,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( 'xmlrpc_call', 'mt.getPostCategories', $args, $this );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $categories = array();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $catids = wp_get_post_categories( (int) $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $catids = wp_get_post_categories( (int) $post_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> // First listed category will be the primary category.
</span><span class="cx" style="display: block; padding: 0 10px"> $isPrimary = true;
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $catids as $catid ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6657,7 +6657,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function mt_setPostCategories( $args ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->escape( $args );
</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_ID = (int) $args[0];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_id = (int) $args[0];
</ins><span class="cx" style="display: block; padding: 0 10px"> $username = $args[1];
</span><span class="cx" style="display: block; padding: 0 10px"> $password = $args[2];
</span><span class="cx" style="display: block; padding: 0 10px"> $categories = $args[3];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6670,11 +6670,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( 'xmlrpc_call', 'mt.setPostCategories', $args, $this );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! get_post( $post_ID ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! get_post( $post_id ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return new IXR_Error( 404, __( 'Invalid post ID.' ) );
</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">- if ( ! current_user_can( 'edit_post', $post_ID ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! current_user_can( 'edit_post', $post_id ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) );
</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">@@ -6683,7 +6683,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $catids[] = $cat['categoryId'];
</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">- wp_set_post_categories( $post_ID, $catids );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_set_post_categories( $post_id, $catids );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6728,22 +6728,22 @@
</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 $post_ID
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $post_id
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return array|IXR_Error
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function mt_getTrackbackPings( $post_ID ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function mt_getTrackbackPings( $post_id ) {
</ins><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"> /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- do_action( 'xmlrpc_call', 'mt.getTrackbackPings', $post_ID, $this );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ do_action( 'xmlrpc_call', 'mt.getTrackbackPings', $post_id, $this );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $actual_post = get_post( $post_ID, ARRAY_A );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $actual_post = get_post( $post_id, ARRAY_A );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $actual_post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return new IXR_Error( 404, __( 'Sorry, no such post.' ) );
</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">- $comments = $wpdb->get_results( $wpdb->prepare( "SELECT comment_author_url, comment_content, comment_author_IP, comment_type FROM $wpdb->comments WHERE comment_post_ID = %d", $post_ID ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $comments = $wpdb->get_results( $wpdb->prepare( "SELECT comment_author_url, comment_content, comment_author_IP, comment_type FROM $wpdb->comments WHERE comment_post_ID = %d", $post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $comments ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return array();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6782,7 +6782,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function mt_publishPost( $args ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->escape( $args );
</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_ID = (int) $args[0];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_id = (int) $args[0];
</ins><span class="cx" style="display: block; padding: 0 10px"> $username = $args[1];
</span><span class="cx" style="display: block; padding: 0 10px"> $password = $args[2];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6794,12 +6794,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( 'xmlrpc_call', 'mt.publishPost', $args, $this );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $postdata = get_post( $post_ID, ARRAY_A );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $postdata = get_post( $post_id, ARRAY_A );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $postdata ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return new IXR_Error( 404, __( 'Invalid post ID.' ) );
</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">- if ( ! current_user_can( 'publish_posts' ) || ! current_user_can( 'edit_post', $post_ID ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! current_user_can( 'publish_posts' ) || ! current_user_can( 'edit_post', $post_id ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return new IXR_Error( 401, __( 'Sorry, you are not allowed to publish this post.' ) );
</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">@@ -6806,7 +6806,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $postdata['post_status'] = 'publish';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Retain old categories.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $postdata['post_category'] = wp_get_post_categories( $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $postdata['post_category'] = wp_get_post_categories( $post_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->escape( $postdata );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return wp_update_post( $postdata );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6870,31 +6870,31 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * If so, then let's use it and drop the old code.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $urltest = parse_url( $pagelinkedto );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $post_ID = url_to_postid( $pagelinkedto );
- if ( $post_ID ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_id = url_to_postid( $pagelinkedto );
+ if ( $post_id ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> // $way
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( isset( $urltest['path'] ) && preg_match( '#p/[0-9]{1,}#', $urltest['path'], $match ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // The path defines the post_ID (archives/p/XXXX).
</span><span class="cx" style="display: block; padding: 0 10px"> $blah = explode( '/', $match[0] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $post_ID = (int) $blah[1];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_id = (int) $blah[1];
</ins><span class="cx" style="display: block; padding: 0 10px"> } elseif ( isset( $urltest['query'] ) && preg_match( '#p=[0-9]{1,}#', $urltest['query'], $match ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // The query string defines the post_ID (?p=XXXX).
</span><span class="cx" style="display: block; padding: 0 10px"> $blah = explode( '=', $match[0] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $post_ID = (int) $blah[1];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_id = (int) $blah[1];
</ins><span class="cx" style="display: block; padding: 0 10px"> } elseif ( isset( $urltest['fragment'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // An #anchor is there, it's either...
</span><span class="cx" style="display: block; padding: 0 10px"> if ( (int) $urltest['fragment'] ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // ...an integer #XXXX (simplest case),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $post_ID = (int) $urltest['fragment'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_id = (int) $urltest['fragment'];
</ins><span class="cx" style="display: block; padding: 0 10px"> } elseif ( preg_match( '/post-[0-9]+/', $urltest['fragment'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // ...a post ID in the form 'post-###',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $post_ID = preg_replace( '/[^0-9]+/', '', $urltest['fragment'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_id = preg_replace( '/[^0-9]+/', '', $urltest['fragment'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> } elseif ( is_string( $urltest['fragment'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // ...or a string #title, a little more complicated.
</span><span class="cx" style="display: block; padding: 0 10px"> $title = preg_replace( '/[^a-z0-9]/i', '.', $urltest['fragment'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $sql = $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_title RLIKE %s", $title );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $post_ID = $wpdb->get_var( $sql );
- if ( ! $post_ID ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_id = $wpdb->get_var( $sql );
+ if ( ! $post_id ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> // Returning unknown error '0' is better than die()'ing.
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->pingback_error( 0, '' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6903,15 +6903,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // TODO: Attempt to extract a post ID from the given URL.
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->pingback_error( 33, __( 'The specified target URL cannot be used as a target. It either does not exist, or it is not a pingback-enabled resource.' ) );
</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_ID = (int) $post_ID;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_id = (int) $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">- $post = get_post( $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post = get_post( $post_id );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post ) { // Post not found.
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->pingback_error( 33, __( 'The specified target URL cannot be used as a target. It either does not exist, or it is not a pingback-enabled resource.' ) );
</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">- if ( url_to_postid( $pagelinkedfrom ) == $post_ID ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( url_to_postid( $pagelinkedfrom ) == $post_id ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return $this->pingback_error( 0, __( 'The source URL and the target URL cannot both point to the same resource.' ) );
</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">@@ -6921,7 +6921,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"> // Let's check that the remote site didn't already pingback this entry.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_author_url = %s", $post_ID, $pagelinkedfrom ) ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_author_url = %s", $post_id, $pagelinkedfrom ) ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return $this->pingback_error( 48, __( 'The pingback has already been registered.' ) );
</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">@@ -7020,7 +7020,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $context = '[…] ' . esc_html( $excerpt ) . ' […]';
</span><span class="cx" style="display: block; padding: 0 10px"> $pagelinkedfrom = $this->escape( $pagelinkedfrom );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $comment_post_id = (int) $post_ID;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $comment_post_id = (int) $post_id;
</ins><span class="cx" style="display: block; padding: 0 10px"> $comment_author = $title;
</span><span class="cx" style="display: block; padding: 0 10px"> $comment_author_email = '';
</span><span class="cx" style="display: block; padding: 0 10px"> $this->escape( $comment_author );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7082,13 +7082,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $url = $this->escape( $url );
</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_ID = url_to_postid( $url );
- if ( ! $post_ID ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_id = url_to_postid( $url );
+ if ( ! $post_id ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> // We aren't sure that the resource is available and/or pingback enabled.
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->pingback_error( 33, __( 'The specified target URL cannot be used as a target. It either does not exist, or it is not a pingback-enabled resource.' ) );
</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">- $actual_post = get_post( $post_ID, ARRAY_A );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $actual_post = get_post( $post_id, ARRAY_A );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $actual_post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // No such post = resource not found.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7095,7 +7095,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->pingback_error( 32, __( 'The specified target URL does not exist.' ) );
</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">- $comments = $wpdb->get_results( $wpdb->prepare( "SELECT comment_author_url, comment_content, comment_author_IP, comment_type FROM $wpdb->comments WHERE comment_post_ID = %d", $post_ID ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $comments = $wpdb->get_results( $wpdb->prepare( "SELECT comment_author_url, comment_content, comment_author_IP, comment_type FROM $wpdb->comments WHERE comment_post_ID = %d", $post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $comments ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return array();
</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 2023-02-18 15:07:12 UTC (rev 55364)
+++ trunk/src/wp-includes/deprecated.php 2023-02-19 15:03:50 UTC (rev 55365)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -741,12 +741,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @see wp_get_post_categories()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $blogid Not Used
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int $post_ID
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $post_id
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return 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">-function wp_get_post_cats($blogid = '1', $post_ID = 0) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function wp_get_post_cats($blogid = '1', $post_id = 0) {
</ins><span class="cx" style="display: block; padding: 0 10px"> _deprecated_function( __FUNCTION__, '2.1.0', 'wp_get_post_categories()' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return wp_get_post_categories($post_ID);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return wp_get_post_categories($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">@@ -758,13 +758,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @see wp_set_post_categories()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $blogid Not used
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int $post_ID
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $post_id
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param array $post_categories
</span><span class="cx" style="display: block; padding: 0 10px"> * @return bool|mixed
</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_cats($blogid = '1', $post_ID = 0, $post_categories = array()) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function wp_set_post_cats($blogid = '1', $post_id = 0, $post_categories = array()) {
</ins><span class="cx" style="display: block; padding: 0 10px"> _deprecated_function( __FUNCTION__, '2.1.0', 'wp_set_post_categories()' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return wp_set_post_categories($post_ID, $post_categories);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return wp_set_post_categories($post_id, $post_categories);
</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="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 2023-02-18 15:07:12 UTC (rev 55364)
+++ trunk/src/wp-includes/post.php 2023-02-19 15:03:50 UTC (rev 55365)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4093,7 +4093,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $postarr = sanitize_post( $postarr, 'db' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Are we updating or creating?
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $post_ID = 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_id = 0;
</ins><span class="cx" style="display: block; padding: 0 10px"> $update = false;
</span><span class="cx" style="display: block; padding: 0 10px"> $guid = $postarr['guid'];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4101,8 +4101,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $update = true;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Get the post ID and GUID.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $post_ID = $postarr['ID'];
- $post_before = get_post( $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_id = $postarr['ID'];
+ $post_before = get_post( $post_id );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_null( $post_before ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $wp_error ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4111,8 +4111,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return 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">- $guid = get_post_field( 'guid', $post_ID );
- $previous_status = get_post_field( 'post_status', $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $guid = get_post_field( 'guid', $post_id );
+ $previous_status = get_post_field( 'post_status', $post_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $previous_status = 'new';
</span><span class="cx" style="display: block; padding: 0 10px"> $post_before = null;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4194,7 +4194,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $update && $post_type_object && ! current_user_can( $post_type_object->cap->publish_posts ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $post_name = '';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif ( $update && ! current_user_can( 'publish_post', $post_ID ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif ( $update && ! current_user_can( 'publish_post', $post_id ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $post_name = '';
</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">@@ -4213,7 +4213,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // On updates, we need to check to see if it's using the old, fixed sanitization context.
</span><span class="cx" style="display: block; padding: 0 10px"> $check_name = sanitize_title( $post_name, '', 'old-save' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $update && strtolower( urlencode( $post_name ) ) == $check_name && get_post_field( 'post_name', $post_ID ) == $check_name ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $update && strtolower( urlencode( $post_name ) ) == $check_name && get_post_field( 'post_name', $post_id ) == $check_name ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $post_name = $check_name;
</span><span class="cx" style="display: block; padding: 0 10px"> } else { // New post, or slug has changed.
</span><span class="cx" style="display: block; padding: 0 10px"> $post_name = sanitize_title( $post_name );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4308,7 +4308,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $new_postarr = array_merge(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'ID' => $post_ID,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'ID' => $post_id,
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> compact( array_diff( array_keys( $defaults ), array( 'context', 'filter' ) ) )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4319,11 +4319,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.1.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $post_parent Post parent ID.
</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"> * @param array $new_postarr Array of parsed post data.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $postarr Array of sanitized, but otherwise unmodified post data.
</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_parent = apply_filters( 'wp_insert_post_parent', $post_parent, $post_ID, $new_postarr, $postarr );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_parent = apply_filters( 'wp_insert_post_parent', $post_parent, $post_id, $new_postarr, $postarr );
</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"> * If the post is being untrashed and it has a desired slug stored in post meta,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4330,10 +4330,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * reassign it.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'trash' === $previous_status && 'trash' !== $post_status ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $desired_post_slug = get_post_meta( $post_ID, '_wp_desired_post_slug', true );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $desired_post_slug = get_post_meta( $post_id, '_wp_desired_post_slug', true );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $desired_post_slug ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- delete_post_meta( $post_ID, '_wp_desired_post_slug' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ delete_post_meta( $post_id, '_wp_desired_post_slug' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $post_name = $desired_post_slug;
</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">@@ -4347,21 +4347,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $add_trashed_suffix Whether to attempt to add the suffix.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $post_name The name of the post being updated.
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $add_trashed_suffix = apply_filters( 'add_trashed_suffix_to_trashed_posts', true, $post_name, $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $add_trashed_suffix = apply_filters( 'add_trashed_suffix_to_trashed_posts', true, $post_name, $post_id );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $add_trashed_suffix ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_add_trashed_suffix_to_post_name_for_trashed_posts( $post_name, $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_add_trashed_suffix_to_post_name_for_trashed_posts( $post_name, $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="cx" style="display: block; padding: 0 10px"> // When trashing an existing post, change its slug to allow non-trashed posts to use it.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'trash' === $post_status && 'trash' !== $previous_status && 'new' !== $previous_status ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $post_name = wp_add_trashed_suffix_to_post_name_for_post( $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_name = wp_add_trashed_suffix_to_post_name_for_post( $post_id );
</ins><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_name = wp_unique_post_slug( $post_name, $post_ID, $post_status, $post_type, $post_parent );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_name = wp_unique_post_slug( $post_name, $post_id, $post_status, $post_type, $post_parent );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Don't unslash.
</span><span class="cx" style="display: block; padding: 0 10px"> $post_mime_type = isset( $postarr['post_mime_type'] ) ? $postarr['post_mime_type'] : '';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4436,7 +4436,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"> $data = wp_unslash( $data );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $where = array( 'ID' => $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $where = array( 'ID' => $post_id );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $update ) {
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4444,10 +4444,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 $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"> * @param array $data Array of unslashed post data.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- do_action( 'pre_post_update', $post_ID, $data );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ do_action( 'pre_post_update', $post_id, $data );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( false === $wpdb->update( $wpdb->posts, $data, $where ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $wp_error ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4486,25 +4486,25 @@
</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">- $post_ID = (int) $wpdb->insert_id;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_id = (int) $wpdb->insert_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">- // Use the newly generated $post_ID.
- $where = array( 'ID' => $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Use the newly generated $post_id.
+ $where = array( 'ID' => $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"> if ( empty( $data['post_name'] ) && ! in_array( $data['post_status'], array( 'draft', 'pending', 'auto-draft' ), true ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $data['post_name'] = wp_unique_post_slug( sanitize_title( $data['post_title'], $post_ID ), $post_ID, $data['post_status'], $post_type, $post_parent );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $data['post_name'] = wp_unique_post_slug( sanitize_title( $data['post_title'], $post_id ), $post_id, $data['post_status'], $post_type, $post_parent );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $wpdb->update( $wpdb->posts, array( 'post_name' => $data['post_name'] ), $where );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- clean_post_cache( $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ clean_post_cache( $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"> if ( is_object_in_taxonomy( $post_type, 'category' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_set_post_categories( $post_ID, $post_category );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_set_post_categories( $post_id, $post_category );
</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"> if ( isset( $postarr['tags_input'] ) && is_object_in_taxonomy( $post_type, 'post_tag' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_set_post_tags( $post_ID, $postarr['tags_input'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_set_post_tags( $post_id, $postarr['tags_input'] );
</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"> // Add default term for all associated custom taxonomies.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4519,7 +4519,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"> // Passed custom taxonomy list overwrites the existing list if not empty.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $terms = wp_get_object_terms( $post_ID, $taxonomy, array( 'fields' => 'ids' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $terms = wp_get_object_terms( $post_id, $taxonomy, array( 'fields' => 'ids' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $terms ) && empty( $postarr['tax_input'][ $taxonomy ] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $postarr['tax_input'][ $taxonomy ] = $terms;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4551,7 +4551,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"> if ( current_user_can( $taxonomy_obj->cap->assign_terms ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_set_post_terms( $post_ID, $tags, $taxonomy );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_set_post_terms( $post_id, $tags, $taxonomy );
</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">@@ -4558,24 +4558,24 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $postarr['meta_input'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $postarr['meta_input'] as $field => $value ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- update_post_meta( $post_ID, $field, $value );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ update_post_meta( $post_id, $field, $value );
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $current_guid = get_post_field( 'guid', $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $current_guid = get_post_field( 'guid', $post_id );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Set GUID.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $update && '' === $current_guid ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $wpdb->update( $wpdb->posts, array( 'guid' => get_permalink( $post_ID ) ), $where );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $wpdb->update( $wpdb->posts, array( 'guid' => get_permalink( $post_id ) ), $where );
</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"> if ( 'attachment' === $postarr['post_type'] ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $postarr['file'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- update_attached_file( $post_ID, $postarr['file'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ update_attached_file( $post_id, $postarr['file'] );
</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"> if ( ! empty( $postarr['context'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- add_post_meta( $post_ID, '_wp_attachment_context', $postarr['context'], true );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ add_post_meta( $post_id, '_wp_attachment_context', $postarr['context'], true );
</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">@@ -4584,9 +4584,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $thumbnail_support = current_theme_supports( 'post-thumbnails', $post_type ) && post_type_supports( $post_type, 'thumbnail' ) || 'revision' === $post_type;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $thumbnail_support && 'attachment' === $post_type && $post_mime_type ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( wp_attachment_is( 'audio', $post_ID ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( wp_attachment_is( 'audio', $post_id ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $thumbnail_support = post_type_supports( 'attachment:audio', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:audio' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif ( wp_attachment_is( 'video', $post_ID ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif ( wp_attachment_is( 'video', $post_id ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $thumbnail_support = post_type_supports( 'attachment:video', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:video' );
</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">@@ -4594,16 +4594,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $thumbnail_support ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $thumbnail_id = (int) $postarr['_thumbnail_id'];
</span><span class="cx" style="display: block; padding: 0 10px"> if ( -1 === $thumbnail_id ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- delete_post_thumbnail( $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ delete_post_thumbnail( $post_id );
</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">- set_post_thumbnail( $post_ID, $thumbnail_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ set_post_thumbnail( $post_id, $thumbnail_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="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- clean_post_cache( $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ clean_post_cache( $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">- $post = get_post( $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post = get_post( $post_id );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $postarr['page_template'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $post->page_template = $postarr['page_template'];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4614,9 +4614,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return new WP_Error( 'invalid_page_template', __( 'Invalid page template.' ) );
</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">- update_post_meta( $post_ID, '_wp_page_template', 'default' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ update_post_meta( $post_id, '_wp_page_template', 'default' );
</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">- update_post_meta( $post_ID, '_wp_page_template', $postarr['page_template'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ update_post_meta( $post_id, '_wp_page_template', $postarr['page_template'] );
</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">@@ -4629,11 +4629,11 @@
</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 $post_ID Attachment ID.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $post_id Attachment 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">- do_action( 'edit_attachment', $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ do_action( 'edit_attachment', $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">- $post_after = get_post( $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_after = get_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"> * Fires once an existing attachment has been updated.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4640,11 +4640,11 @@
</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 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"> * @param WP_Post $post_after Post object following the update.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param WP_Post $post_before Post object before the update.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- do_action( 'attachment_updated', $post_ID, $post_after, $post_before );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ do_action( 'attachment_updated', $post_id, $post_after, $post_before );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</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">@@ -4652,12 +4652,12 @@
</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 $post_ID Attachment ID.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $post_id Attachment 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">- do_action( 'add_attachment', $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ do_action( 'add_attachment', $post_id );
</ins><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">- return $post_ID;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $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"> if ( $update ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4674,10 +4674,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 5.1.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 $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"> * @param WP_Post $post Post 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">- do_action( "edit_post_{$post->post_type}", $post_ID, $post );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ do_action( "edit_post_{$post->post_type}", $post_id, $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"> * Fires once an existing post has been updated.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4684,12 +4684,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</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><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"> * @param WP_Post $post Post 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">- do_action( 'edit_post', $post_ID, $post );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ do_action( 'edit_post', $post_id, $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_after = get_post( $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_after = get_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"> * Fires once an existing post has been updated.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4696,11 +4696,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.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 $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"> * @param WP_Post $post_after Post object following the update.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param WP_Post $post_before Post object before the update.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- do_action( 'post_updated', $post_ID, $post_after, $post_before );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ do_action( 'post_updated', $post_id, $post_after, $post_before );
</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">@@ -4716,11 +4716,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.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 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"> * @param WP_Post $post Post object.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $update Whether this is an existing post being 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">- do_action( "save_post_{$post->post_type}", $post_ID, $post, $update );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ do_action( "save_post_{$post->post_type}", $post_id, $post, $update );
</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"> * Fires once a post has been saved.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4727,11 +4727,11 @@
</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 $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"> * @param WP_Post $post Post object.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $update Whether this is an existing post being 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">- do_action( 'save_post', $post_ID, $post, $update );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ do_action( 'save_post', $post_id, $post, $update );
</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"> * Fires once a post has been saved.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4738,17 +4738,17 @@
</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 $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"> * @param WP_Post $post Post object.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $update Whether this is an existing post being 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">- do_action( 'wp_insert_post', $post_ID, $post, $update );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ do_action( 'wp_insert_post', $post_id, $post, $update );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $fire_after_hooks ) {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_after_insert_post( $post, $update, $post_before );
</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">- return $post_ID;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $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">@@ -4993,13 +4993,13 @@
</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><span class="cx" style="display: block; padding: 0 10px"> * @param string $slug The desired slug (post_name).
</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"> * @param string $post_status No uniqueness checks are made if the post is still draft or pending.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $post_type Post type.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $post_parent Post parent ID.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string Unique slug for the post, based on $post_name (with a -1, -2, etc. suffix)
</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_unique_post_slug( $slug, $post_ID, $post_status, $post_type, $post_parent ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function wp_unique_post_slug( $slug, $post_id, $post_status, $post_type, $post_parent ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( in_array( $post_status, array( 'draft', 'pending', 'auto-draft' ), true )
</span><span class="cx" style="display: block; padding: 0 10px"> || ( 'inherit' === $post_status && 'revision' === $post_type ) || 'user_request' === $post_type
</span><span class="cx" style="display: block; padding: 0 10px"> ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5016,12 +5016,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string|null $override_slug Short-circuit return value.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $slug The desired slug (post_name).
</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"> * @param string $post_status The post status.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $post_type Post type.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $post_parent Post parent ID.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $override_slug = apply_filters( 'pre_wp_unique_post_slug', null, $slug, $post_ID, $post_status, $post_type, $post_parent );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $override_slug = apply_filters( 'pre_wp_unique_post_slug', null, $slug, $post_id, $post_status, $post_type, $post_parent );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( null !== $override_slug ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $override_slug;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5038,7 +5038,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'attachment' === $post_type ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Attachment slugs must be unique across all types.
</span><span class="cx" style="display: block; padding: 0 10px"> $check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND ID != %d LIMIT 1";
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $slug, $post_ID ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $slug, $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"> * Filters whether the post slug would make a bad attachment slug.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5057,7 +5057,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $suffix = 2;
</span><span class="cx" style="display: block; padding: 0 10px"> do {
</span><span class="cx" style="display: block; padding: 0 10px"> $alt_post_name = _truncate_post_slug( $slug, 200 - ( strlen( $suffix ) + 1 ) ) . "-$suffix";
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $alt_post_name, $post_ID ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $alt_post_name, $post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $suffix++;
</span><span class="cx" style="display: block; padding: 0 10px"> } while ( $post_name_check );
</span><span class="cx" style="display: block; padding: 0 10px"> $slug = $alt_post_name;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5072,7 +5072,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * namespace than posts so page slugs are allowed to overlap post slugs.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type IN ( %s, 'attachment' ) AND ID != %d AND post_parent = %d LIMIT 1";
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $slug, $post_type, $post_ID, $post_parent ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $slug, $post_type, $post_id, $post_parent ) );
</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 whether the post slug would make a bad hierarchical post slug.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5094,7 +5094,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $suffix = 2;
</span><span class="cx" style="display: block; padding: 0 10px"> do {
</span><span class="cx" style="display: block; padding: 0 10px"> $alt_post_name = _truncate_post_slug( $slug, 200 - ( strlen( $suffix ) + 1 ) ) . "-$suffix";
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $alt_post_name, $post_type, $post_ID, $post_parent ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $alt_post_name, $post_type, $post_id, $post_parent ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $suffix++;
</span><span class="cx" style="display: block; padding: 0 10px"> } while ( $post_name_check );
</span><span class="cx" style="display: block; padding: 0 10px"> $slug = $alt_post_name;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5102,9 +5102,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> // Post slugs must be unique across all posts.
</span><span class="cx" style="display: block; padding: 0 10px"> $check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type = %s AND ID != %d LIMIT 1";
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $slug, $post_type, $post_ID ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $slug, $post_type, $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">- $post = get_post( $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post = get_post( $post_id );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Prevent new post slugs that could result in URLs that conflict with date archives.
</span><span class="cx" style="display: block; padding: 0 10px"> $conflicts_with_date_archive = false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5150,7 +5150,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $suffix = 2;
</span><span class="cx" style="display: block; padding: 0 10px"> do {
</span><span class="cx" style="display: block; padding: 0 10px"> $alt_post_name = _truncate_post_slug( $slug, 200 - ( strlen( $suffix ) + 1 ) ) . "-$suffix";
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $alt_post_name, $post_type, $post_ID ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $alt_post_name, $post_type, $post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $suffix++;
</span><span class="cx" style="display: block; padding: 0 10px"> } while ( $post_name_check );
</span><span class="cx" style="display: block; padding: 0 10px"> $slug = $alt_post_name;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5163,13 +5163,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.3.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $slug The post slug.
</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"> * @param string $post_status The post status.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $post_type Post type.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $post_parent Post parent ID
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $original_slug The original post slug.
</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_unique_post_slug', $slug, $post_ID, $post_status, $post_type, $post_parent, $original_slug );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return apply_filters( 'wp_unique_post_slug', $slug, $post_id, $post_status, $post_type, $post_parent, $original_slug );
</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">@@ -5285,7 +5285,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int $post_ID Optional. The Post ID. Does not default to the ID
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $post_id Optional. The Post ID. Does not default to the ID
</ins><span class="cx" style="display: block; padding: 0 10px"> * of the global $post. Default 0.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int[]|int $post_categories Optional. List of category IDs, or the ID of a single category.
</span><span class="cx" style="display: block; padding: 0 10px"> * Default empty array.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5293,10 +5293,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * If false, replace the categories with the new categories.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array|false|WP_Error Array of term taxonomy IDs of affected categories. WP_Error or false 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 wp_set_post_categories( $post_ID = 0, $post_categories = array(), $append = false ) {
- $post_ID = (int) $post_ID;
- $post_type = get_post_type( $post_ID );
- $post_status = get_post_status( $post_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function wp_set_post_categories( $post_id = 0, $post_categories = array(), $append = false ) {
+ $post_id = (int) $post_id;
+ $post_type = get_post_type( $post_id );
+ $post_status = get_post_status( $post_id );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // If $post_categories isn't already an array, make it one.
</span><span class="cx" style="display: block; padding: 0 10px"> $post_categories = (array) $post_categories;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5327,7 +5327,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</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">- return wp_set_post_terms( $post_ID, $post_categories, 'category', $append );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return wp_set_post_terms( $post_id, $post_categories, 'category', $append );
</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">@@ -7671,10 +7671,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @see wp_find_hierarchy_loop()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $post_parent ID of the parent for the post we're checking.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int $post_ID ID of the post we're checking.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $post_id ID of the post we're checking.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return int The new post_parent for the post, 0 otherwise.
</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_hierarchy_for_loops( $post_parent, $post_ID ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function wp_check_post_hierarchy_for_loops( $post_parent, $post_id ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> // Nothing fancy here - bail.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post_parent ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return 0;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7681,27 +7681,27 @@
</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"> // New post can't cause a loop.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! $post_ID ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! $post_id ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return $post_parent;
</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"> // Can't be its own parent.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $post_parent == $post_ID ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $post_parent == $post_id ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return 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"> // Now look for larger loops.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $loop = wp_find_hierarchy_loop( 'wp_get_post_parent_id', $post_ID, $post_parent );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $loop = wp_find_hierarchy_loop( 'wp_get_post_parent_id', $post_id, $post_parent );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $loop ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $post_parent; // No loop.
</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"> // Setting $post_parent to the given value causes a loop.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( isset( $loop[ $post_ID ] ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( isset( $loop[ $post_id ] ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return 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">- // There's a loop, but it doesn't contain $post_ID. Break the loop.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // There's a loop, but it doesn't contain $post_id. Break the loop.
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( array_keys( $loop ) as $loop_member ) {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_update_post(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7917,9 +7917,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @access private
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $post_name Post slug.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int $post_ID Optional. Post ID that should be ignored. Default 0.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $post_id Optional. Post ID that should be ignored. Default 0.
</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_add_trashed_suffix_to_post_name_for_trashed_posts( $post_name, $post_ID = 0 ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function wp_add_trashed_suffix_to_post_name_for_trashed_posts( $post_name, $post_id = 0 ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $trashed_posts_with_desired_slug = get_posts(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'name' => $post_name,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7926,7 +7926,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_status' => 'trash',
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_type' => 'any',
</span><span class="cx" style="display: block; padding: 0 10px"> 'nopaging' => true,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'post__not_in' => array( $post_ID ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'post__not_in' => array( $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></pre></div>
<a id="trunksrcwpincludesthemetemplatesphp"></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/theme-templates.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/theme-templates.php 2023-02-18 15:07:12 UTC (rev 55364)
+++ trunk/src/wp-includes/theme-templates.php 2023-02-19 15:03:50 UTC (rev 55365)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -39,12 +39,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $override_slug The filtered value of the slug (starts as `null` from apply_filter).
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $slug The original/un-filtered slug (post_name).
</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"> * @param string $post_status No uniqueness checks are made if the post is still draft or pending.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $post_type Post type.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string The original, desired slug.
</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_filter_wp_template_unique_post_slug( $override_slug, $slug, $post_ID, $post_status, $post_type ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function wp_filter_wp_template_unique_post_slug( $override_slug, $slug, $post_id, $post_status, $post_type ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( 'wp_template' !== $post_type && 'wp_template_part' !== $post_type ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $override_slug;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -61,7 +61,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * to the entity. So for now we use the currently activated theme for creation.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $theme = get_stylesheet();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $terms = get_the_terms( $post_ID, 'wp_theme' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $terms = get_the_terms( $post_id, 'wp_theme' );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $terms && ! is_wp_error( $terms ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $theme = $terms[0]->name;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -71,7 +71,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_type' => $post_type,
</span><span class="cx" style="display: block; padding: 0 10px"> 'posts_per_page' => 1,
</span><span class="cx" style="display: block; padding: 0 10px"> 'no_found_rows' => true,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'post__not_in' => array( $post_ID ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'post__not_in' => array( $post_id ),
</ins><span class="cx" style="display: block; padding: 0 10px"> 'tax_query' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'taxonomy' => 'wp_theme',
</span></span></pre></div>
<a id="trunktestsphpunittestspostphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/post.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/post.php 2023-02-18 15:07:12 UTC (rev 55364)
+++ trunk/tests/phpunit/tests/post.php 2023-02-19 15:03:50 UTC (rev 55365)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -467,7 +467,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'pre_wp_unique_post_slug', array( $this, 'filter_pre_wp_unique_post_slug' ), 10, 6 );
</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">- public function filter_pre_wp_unique_post_slug( $override_slug, $slug, $post_ID, $post_status, $post_type, $post_parent ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function filter_pre_wp_unique_post_slug( $override_slug, $slug, $post_id, $post_status, $post_type, $post_parent ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return 'override-slug-' . $post_type;
</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="trunktestsphpunitteststermisObjectInTermphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/term/isObjectInTerm.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/term/isObjectInTerm.php 2023-02-18 15:07:12 UTC (rev 55364)
+++ trunk/tests/phpunit/tests/term/isObjectInTerm.php 2023-02-19 15:03:50 UTC (rev 55365)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -119,16 +119,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> register_taxonomy( 'wptests_tax', 'post' );
</span><span class="cx" style="display: block; padding: 0 10px"> $t = self::factory()->term->create( array( 'taxonomy' => 'wptests_tax' ) );
</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_ID = self::factory()->post->create();
- wp_set_object_terms( $post_ID, $t, 'wptests_tax' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_id = self::factory()->post->create();
+ wp_set_object_terms( $post_id, $t, 'wptests_tax' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $int_tax_name = $t . '_term_name';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertFalse( is_object_in_term( $post_ID, 'wptests_tax', $int_tax_name ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( is_object_in_term( $post_id, 'wptests_tax', $int_tax_name ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Verify it works properly when the post is actually in the term.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_set_object_terms( $post_ID, array( $int_tax_name ), 'wptests_tax' );
- $this->assertTrue( is_object_in_term( $post_ID, 'wptests_tax', $int_tax_name ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_set_object_terms( $post_id, array( $int_tax_name ), 'wptests_tax' );
+ $this->assertTrue( is_object_in_term( $post_id, 'wptests_tax', $int_tax_name ) );
</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>
</div>
</body>
</html>