<!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>[56193] trunk/src/wp-includes: Docs: Replace multiple single line comments with multi-line comments.</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/56193">56193</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/56193","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>audrasjb</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2023-07-10 22:58:33 +0000 (Mon, 10 Jul 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'>Docs: Replace multiple single line comments with multi-line comments.
This changeset updates various comments as per WordPress PHP Inline Documentation Standards.
See https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/<a href="https://core.trac.wordpress.org/ticket/5">#5</a>-inline-comments.
Follow-up to <a href="https://core.trac.wordpress.org/changeset/56174">[56174]</a>, <a href="https://core.trac.wordpress.org/changeset/56175">[56175]</a>, <a href="https://core.trac.wordpress.org/changeset/56176">[56176]</a>, <a href="https://core.trac.wordpress.org/changeset/56177">[56177]</a>, <a href="https://core.trac.wordpress.org/changeset/56178">[56178]</a>, <a href="https://core.trac.wordpress.org/changeset/56179">[56179]</a>, <a href="https://core.trac.wordpress.org/changeset/56180">[56180]</a>, <a href="https://core.trac.wordpress.org/changeset/56191">[56191]</a>, <a href="https://core.trac.wordpress.org/changeset/56192">[56192]</a>.
Props costdev, audrasjb.
See <a href="https://core.trac.wordpress.org/ticket/58459">#58459</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludescustomizeclasswpcustomizeheaderimagesettingphp">trunk/src/wp-includes/customize/class-wp-customize-header-image-setting.php</a></li>
<li><a href="#trunksrcwpincludescustomizeclasswpcustomizemediacontrolphp">trunk/src/wp-includes/customize/class-wp-customize-media-control.php</a></li>
<li><a href="#trunksrcwpincludescustomizeclasswpcustomizethemessectionphp">trunk/src/wp-includes/customize/class-wp-customize-themes-section.php</a></li>
<li><a href="#trunksrcwpincludesrestapiclasswprestrequestphp">trunk/src/wp-includes/rest-api/class-wp-rest-request.php</a></li>
<li><a href="#trunksrcwpincludesrestapiclasswprestserverphp">trunk/src/wp-includes/rest-api/class-wp-rest-server.php</a></li>
<li><a href="#trunksrcwpincludesrestapiendpointsclasswprestattachmentscontrollerphp">trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php</a></li>
<li><a href="#trunksrcwpincludesrestapiendpointsclasswprestautosavescontrollerphp">trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php</a></li>
<li><a href="#trunksrcwpincludesrestapiendpointsclasswprestcommentscontrollerphp">trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php</a></li>
<li><a href="#trunksrcwpincludesrestapiendpointsclasswprestcontrollerphp">trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-controller.php</a></li>
<li><a href="#trunksrcwpincludesrestapiendpointsclasswprestglobalstylescontrollerphp">trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php</a></li>
<li><a href="#trunksrcwpincludesrestapiendpointsclasswprestpostscontrollerphp">trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludescustomizeclasswpcustomizeheaderimagesettingphp"></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/customize/class-wp-customize-header-image-setting.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/customize/class-wp-customize-header-image-setting.php 2023-07-10 22:46:22 UTC (rev 56192)
+++ trunk/src/wp-includes/customize/class-wp-customize-header-image-setting.php 2023-07-10 22:58:33 UTC (rev 56193)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -45,8 +45,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $custom_image_header = new Custom_Image_Header( $admin_head_callback, $admin_preview_callback );
</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 the value doesn't exist (removed or random),
- // use the header_image value.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * If the value doesn't exist (removed or random),
+ * use the header_image value.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $value ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $value = $this->manager->get_setting( 'header_image' )->post_value();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludescustomizeclasswpcustomizemediacontrolphp"></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/customize/class-wp-customize-media-control.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/customize/class-wp-customize-media-control.php 2023-07-10 22:46:22 UTC (rev 56192)
+++ trunk/src/wp-includes/customize/class-wp-customize-media-control.php 2023-07-10 22:58:33 UTC (rev 56193)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -88,8 +88,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_object( $this->setting ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $this->setting->default ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Fake an attachment model - needs all fields used by template.
- // Note that the default value must be a URL, NOT an attachment ID.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Fake an attachment model - needs all fields used by template.
+ * Note that the default value must be a URL, NOT an attachment ID.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> $ext = substr( $this->setting->default, -3 );
</span><span class="cx" style="display: block; padding: 0 10px"> $type = in_array( $ext, array( 'jpg', 'png', 'gif', 'bmp', 'webp' ), true ) ? 'image' : 'document';
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpincludescustomizeclasswpcustomizethemessectionphp"></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/customize/class-wp-customize-themes-section.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/customize/class-wp-customize-themes-section.php 2023-07-10 22:46:22 UTC (rev 56192)
+++ trunk/src/wp-includes/customize/class-wp-customize-themes-section.php 2023-07-10 22:58:33 UTC (rev 56193)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -184,8 +184,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.9.0
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function filter_drawer_content_template() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // @todo Use the .org API instead of the local core feature list.
- // The .org API is currently outdated and will be reconciled when the .org themes directory is next redesigned.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * @todo Use the .org API instead of the local core feature list.
+ * The .org API is currently outdated and will be reconciled when the .org themes directory is next redesigned.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> $feature_list = get_theme_feature_list( false );
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <# if ( 'wporg' === data.action ) { #>
</span></span></pre></div>
<a id="trunksrcwpincludesrestapiclasswprestrequestphp"></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/rest-api/class-wp-rest-request.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/rest-api/class-wp-rest-request.php 2023-07-10 22:46:22 UTC (rev 56192)
+++ trunk/src/wp-includes/rest-api/class-wp-rest-request.php 2023-07-10 22:58:33 UTC (rev 56193)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -473,8 +473,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $params = array();
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $order as $type ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // array_merge() / the "+" operator will mess up
- // numeric keys, so instead do a manual foreach.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * array_merge() / the "+" operator will mess up
+ * numeric keys, so instead do a manual foreach.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( (array) $this->params[ $type ] as $key => $value ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $params[ $key ] = $value;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludesrestapiclasswprestserverphp"></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/rest-api/class-wp-rest-server.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/rest-api/class-wp-rest-server.php 2023-07-10 22:46:22 UTC (rev 56192)
+++ trunk/src/wp-includes/rest-api/class-wp-rest-server.php 2023-07-10 22:58:33 UTC (rev 56193)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -701,8 +701,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $embedded = array();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $data['_links'] as $rel => $links ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // If a list of relations was specified, and the link relation
- // is not in the list of allowed relations, don't process the link.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * If a list of relations was specified, and the link relation
+ * is not in the list of allowed relations, don't process the link.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( is_array( $embed ) && ! in_array( $rel, $embed, true ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludesrestapiendpointsclasswprestattachmentscontrollerphp"></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/rest-api/endpoints/class-wp-rest-attachments-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php 2023-07-10 22:46:22 UTC (rev 56192)
+++ trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php 2023-07-10 22:58:33 UTC (rev 56193)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -202,8 +202,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_after_insert_post( $attachment, false, null );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Set a custom header with the attachment_id.
- // Used by the browser/client to resume creating image sub-sizes after a PHP fatal error.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Set a custom header with the attachment_id.
+ * Used by the browser/client to resume creating image sub-sizes after a PHP fatal error.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> header( 'X-WP-Upload-Attachment-ID: ' . $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">@@ -211,8 +213,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> require_once ABSPATH . 'wp-admin/includes/media.php';
</span><span class="cx" style="display: block; padding: 0 10px"> require_once ABSPATH . 'wp-admin/includes/image.php';
</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-process the upload (create image sub-sizes, make PDF thumbnails, etc.) and insert attachment meta.
- // At this point the server may run out of resources and post-processing of uploaded images may fail.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Post-process the upload (create image sub-sizes, make PDF thumbnails, etc.) and insert attachment meta.
+ * At this point the server may run out of resources and post-processing of uploaded images may fail.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> wp_update_attachment_metadata( $attachment_id, wp_generate_attachment_metadata( $attachment_id, $file ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = $this->prepare_item_for_response( $attachment, $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -562,8 +566,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $image_ext = pathinfo( $image_file, PATHINFO_EXTENSION );
</span><span class="cx" style="display: block; padding: 0 10px"> $image_name = wp_basename( $image_file, ".{$image_ext}" );
</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 not append multiple `-edited` to the file name.
- // The user may be editing a previously edited image.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Do not append multiple `-edited` to the file name.
+ * The user may be editing a previously edited image.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( preg_match( '/-edited(-\d+)?$/', $image_name ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Remove any `-1`, `-2`, etc. `wp_unique_filename()` will add the proper number.
</span><span class="cx" style="display: block; padding: 0 10px"> $image_name = preg_replace( '/-edited(-\d+)?$/', '-edited', $image_name );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -625,8 +631,10 @@
</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 ( defined( 'REST_REQUEST' ) && REST_REQUEST ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Set a custom header with the attachment_id.
- // Used by the browser/client to resume creating image sub-sizes after a PHP fatal error.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Set a custom header with the attachment_id.
+ * Used by the browser/client to resume creating image sub-sizes after a PHP fatal error.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> header( 'X-WP-Upload-Attachment-ID: ' . $new_attachment_id );
</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="trunksrcwpincludesrestapiendpointsclasswprestautosavescontrollerphp"></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/rest-api/endpoints/class-wp-rest-autosaves-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php 2023-07-10 22:46:22 UTC (rev 56192)
+++ trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php 2023-07-10 22:58:33 UTC (rev 56193)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -229,8 +229,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $is_draft = 'draft' === $post->post_status || 'auto-draft' === $post->post_status;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $is_draft && (int) $post->post_author === $user_id && ! $post_lock ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Draft posts for the same author: autosaving updates the post and does not create a revision.
- // Convert the post object to an array and add slashes, wp_update_post() expects escaped array.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Draft posts for the same author: autosaving updates the post and does not create a revision.
+ * Convert the post object to an array and add slashes, wp_update_post() expects escaped array.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> $autosave_id = wp_update_post( wp_slash( (array) $prepared_post ), true );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> // Non-draft posts: create or update the post autosave.
</span></span></pre></div>
<a id="trunksrcwpincludesrestapiendpointsclasswprestcommentscontrollerphp"></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/rest-api/endpoints/class-wp-rest-comments-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php 2023-07-10 22:46:22 UTC (rev 56192)
+++ trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php 2023-07-10 22:58:33 UTC (rev 56193)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1761,8 +1761,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $posts_controller = $post_type->get_rest_controller();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Ensure the posts controller is specifically a WP_REST_Posts_Controller instance
- // before using methods specific to that controller.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Ensure the posts controller is specifically a WP_REST_Posts_Controller instance
+ * before using methods specific to that controller.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $posts_controller instanceof WP_REST_Posts_Controller ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $posts_controller = new WP_REST_Posts_Controller( $post->post_type );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludesrestapiendpointsclasswprestcontrollerphp"></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/rest-api/endpoints/class-wp-rest-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-controller.php 2023-07-10 22:46:22 UTC (rev 56192)
+++ trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-controller.php 2023-07-10 22:58:33 UTC (rev 56193)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -576,8 +576,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $additional_fields = $this->get_additional_fields();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $additional_fields as $field_name => $field_options ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // For back-compat, include any field with an empty schema
- // because it won't be present in $this->get_item_schema().
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * For back-compat, include any field with an empty schema
+ * because it won't be present in $this->get_item_schema().
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( is_null( $field_options['schema'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $properties[ $field_name ] = $field_options;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -630,8 +632,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> // Check for nested fields if $field is not a direct match.
</span><span class="cx" style="display: block; padding: 0 10px"> $nested_fields = explode( '.', $field );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // A nested field is included so long as its top-level property
- // is present in the schema.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * A nested field is included so long as its top-level property
+ * is present in the schema.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( in_array( $nested_fields[0], $fields, true ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $response_fields[] = $field;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludesrestapiendpointsclasswprestglobalstylescontrollerphp"></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/rest-api/endpoints/class-wp-rest-global-styles-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php 2023-07-10 22:46:22 UTC (rev 56192)
+++ trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php 2023-07-10 22:58:33 UTC (rev 56193)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -61,8 +61,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> sprintf(
</span><span class="cx" style="display: block; padding: 0 10px"> '/%s/themes/(?P<stylesheet>%s)',
</span><span class="cx" style="display: block; padding: 0 10px"> $this->rest_base,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Matches theme's directory: `/themes/<subdirectory>/<theme>/` or `/themes/<theme>/`.
- // Excludes invalid directory name characters: `/:<>*?"|`.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Matches theme's directory: `/themes/<subdirectory>/<theme>/` or `/themes/<theme>/`.
+ * Excludes invalid directory name characters: `/:<>*?"|`.
+ */
</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"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -565,8 +567,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return true|WP_Error True if the request has read access for the item, WP_Error object otherwise.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_theme_item_permissions_check( $request ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Verify if the current user has edit_theme_options capability.
- // This capability is required to edit/view/delete templates.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Verify if the current user has edit_theme_options capability.
+ * This capability is required to edit/view/delete templates.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! current_user_can( 'edit_theme_options' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return new WP_Error(
</span><span class="cx" style="display: block; padding: 0 10px"> 'rest_cannot_manage_global_styles',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -638,8 +642,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return true|WP_Error True if the request has read access for the item, WP_Error object otherwise.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_theme_items_permissions_check( $request ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Verify if the current user has edit_theme_options capability.
- // This capability is required to edit/view/delete templates.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Verify if the current user has edit_theme_options capability.
+ * This capability is required to edit/view/delete templates.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! current_user_can( 'edit_theme_options' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return new WP_Error(
</span><span class="cx" style="display: block; padding: 0 10px"> 'rest_cannot_manage_global_styles',
</span></span></pre></div>
<a id="trunksrcwpincludesrestapiendpointsclasswprestpostscontrollerphp"></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/rest-api/endpoints/class-wp-rest-posts-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php 2023-07-10 22:46:22 UTC (rev 56192)
+++ trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php 2023-07-10 22:58:33 UTC (rev 56193)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1063,8 +1063,10 @@
</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">- // (Note that internally this falls through to `wp_delete_post()`
- // if the Trash is disabled.)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * (Note that internally this falls through to `wp_delete_post()`
+ * if the Trash is disabled.)
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> $result = wp_trash_post( $id );
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $id );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = $this->prepare_item_for_response( $post, $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1269,8 +1271,10 @@
</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">- // Sending a null date or date_gmt value resets date and date_gmt to their
- // default values (`0000-00-00 00:00:00`).
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Sending a null date or date_gmt value resets date and date_gmt to their
+ * default values (`0000-00-00 00:00:00`).
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> if (
</span><span class="cx" style="display: block; padding: 0 10px"> ( ! empty( $schema['properties']['date_gmt'] ) && $request->has_param( 'date_gmt' ) && null === $request['date_gmt'] ) ||
</span><span class="cx" style="display: block; padding: 0 10px"> ( ! empty( $schema['properties']['date'] ) && $request->has_param( 'date' ) && null === $request['date'] )
</span></span></pre>
</div>
</div>
</body>
</html>