<!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>[32565] trunk/src/wp-includes/class-wp-xmlrpc-server.php: Add missing or incomplete argument and return descriptions for `wp_xmlrpc_server->wp_editPost()`.</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 { 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/32565">32565</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/32565","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>DrewAPicture</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2015-05-23 19:46:45 +0000 (Sat, 23 May 2015)</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'>Add missing or incomplete argument and return descriptions for `wp_xmlrpc_server->wp_editPost()`.
Also includes many small syntax fixes for inline documentation throughout the file.
See <a href="https://core.trac.wordpress.org/ticket/32246">#32246</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesclasswpxmlrpcserverphp">trunk/src/wp-includes/class-wp-xmlrpc-server.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<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 2015-05-23 19:40:35 UTC (rev 32564)
+++ trunk/src/wp-includes/class-wp-xmlrpc-server.php 2015-05-23 19:46:45 UTC (rev 32565)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -733,15 +733,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @access protected
</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 array $post The unprepared post data
- * @param array $fields The subset of post type fields to return
- * @return array The prepared post data
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array $post The unprepared post data.
+ * @param array $fields The subset of post type fields to return.
+ * @return array The prepared post data.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function _prepare_post( $post, $fields ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // holds the data for this post. built up based on $fields
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Holds the data for this post. built up based on $fields.
</ins><span class="cx" style="display: block; padding: 0 10px"> $_post = array( 'post_id' => strval( $post['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">- // prepare common post fields
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Prepare common post fields.
</ins><span class="cx" style="display: block; padding: 0 10px"> $post_fields = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_title' => $post['post_title'],
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_date' => $this->_convert_date( $post['post_date'] ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -765,7 +765,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'sticky' => ( $post['post_type'] === 'post' && is_sticky( $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">- // Thumbnail
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Thumbnail.
</ins><span class="cx" style="display: block; padding: 0 10px"> $post_fields['post_thumbnail'] = array();
</span><span class="cx" style="display: block; padding: 0 10px"> $thumbnail_id = get_post_thumbnail_id( $post['ID'] );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $thumbnail_id ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -773,16 +773,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post_fields['post_thumbnail'] = $this->_prepare_media_item( get_post( $thumbnail_id ), $thumbnail_size );
</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">- // Consider future posts as published
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Consider future posts as published.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $post_fields['post_status'] === 'future' )
</span><span class="cx" style="display: block; padding: 0 10px"> $post_fields['post_status'] = 'publish';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Fill in blank post format
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Fill in blank post format.
</ins><span class="cx" style="display: block; padding: 0 10px"> $post_fields['post_format'] = get_post_format( $post['ID'] );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $post_fields['post_format'] ) )
</span><span class="cx" style="display: block; padding: 0 10px"> $post_fields['post_format'] = 'standard';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Merge requested $post_fields fields into $_post
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Merge requested $post_fields fields into $_post.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( in_array( 'post', $fields ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $_post = array_merge( $_post, $post_fields );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -832,9 +832,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @access protected
</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 object $post_type Post type object
- * @param array $fields The subset of post fields to return
- * @return array The prepared post type data
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param object $post_type Post type object.
+ * @param array $fields The subset of post fields to return.
+ * @return array The prepared post type data.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function _prepare_post_type( $post_type, $fields ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $_post_type = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -882,9 +882,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @access protected
</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 object $media_item The unprepared media item data
- * @param string $thumbnail_size The image size to use for the thumbnail URL
- * @return array The prepared media item data
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param object $media_item The unprepared media item data.
+ * @param string $thumbnail_size The image size to use for the thumbnail URL.
+ * @return array The prepared media item data.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function _prepare_media_item( $media_item, $thumbnail_size = 'thumbnail' ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $_media_item = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -921,8 +921,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @access protected
</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 object $page The unprepared page data
- * @return array The prepared page data
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param object $page The unprepared page data.
+ * @return array The prepared page data.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function _prepare_page( $page ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Get all of the page content and link.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1002,8 +1002,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @access protected
</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 object $comment The unprepared comment data
- * @return array The prepared comment data
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param object $comment The unprepared comment data.
+ * @return array The prepared comment data.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function _prepare_comment( $comment ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Format page date.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1051,9 +1051,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @access protected
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param WP_User $user The unprepared user object
- * @param array $fields The subset of user fields to return
- * @return array The prepared user data
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param WP_User $user The unprepared user object.
+ * @param array $fields The subset of user fields to return.
+ * @return array The prepared user data.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function _prepare_user( $user, $fields ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $_user = array( 'user_id' => strval( $user->ID ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1176,12 +1176,14 @@
</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">- * Helper method for wp_newPost and wp_editPost, containing shared logic.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Helper method for wp_newPost() and wp_editPost(), containing shared logic.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.4.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @uses wp_insert_post()
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @access protected
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param WP_User $user The post author if post_author isn't set in $content_struct.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @see wp_insert_post()
+ *
+ * @param WP_User $user The post author if post_author isn't set in $content_struct.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param array|IXR_Error $content_struct Post data to insert.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return IXR_Error|string
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1250,9 +1252,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $post_data['ping_status'] ) && $post_data['ping_status'] != 'open' && $post_data['ping_status'] != 'closed' )
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $post_data['ping_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">- // Do some timestamp voodoo
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Do some timestamp voodoo.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $post_data['post_date_gmt'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // We know this is supposed to be GMT, so we're going to slap that Z on there by force
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // We know this is supposed to be GMT, so we're going to slap that Z on there by force.
</ins><span class="cx" style="display: block; padding: 0 10px"> $dateCreated = rtrim( $post_data['post_date_gmt']->getIso(), 'Z' ) . 'Z';
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( ! empty( $post_data['post_date'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $dateCreated = $post_data['post_date']->getIso();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1286,7 +1288,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_thumbnail'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // empty value deletes, non-empty value adds/updates
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // empty value deletes, non-empty value adds/updates.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post_data['post_thumbnail'] )
</span><span class="cx" style="display: block; padding: 0 10px"> delete_post_thumbnail( $post_ID );
</span><span class="cx" style="display: block; padding: 0 10px"> elseif ( ! get_post( absint( $post_data['post_thumbnail'] ) ) )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1301,14 +1303,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $post_data['terms'] ) || isset( $post_data['terms_names'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $post_type_taxonomies = get_object_taxonomies( $post_data['post_type'], 'objects' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // accumulate term IDs from terms and terms_names
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Accumulate term IDs from terms and terms_names.
</ins><span class="cx" style="display: block; padding: 0 10px"> $terms = 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">- // first validate the terms specified by ID
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // First validate the terms specified by ID.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $post_data['terms'] ) && is_array( $post_data['terms'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $taxonomies = array_keys( $post_data['terms'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // validating term ids
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Validating term ids.
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $taxonomies as $taxonomy ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! array_key_exists( $taxonomy , $post_type_taxonomies ) )
</span><span class="cx" style="display: block; padding: 0 10px"> return new IXR_Error( 401, __( 'Sorry, one of the given taxonomies is not supported by the post type.' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1329,7 +1331,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">- // now validate terms specified by name
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Now validate terms specified by name.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $post_data['terms_names'] ) && is_array( $post_data['terms_names'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $taxonomies = array_keys( $post_data['terms_names'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1340,15 +1342,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! current_user_can( $post_type_taxonomies[$taxonomy]->cap->assign_terms ) )
</span><span class="cx" style="display: block; padding: 0 10px"> return new IXR_Error( 401, __( 'Sorry, you are not allowed to assign a term to one of the given taxonomies.' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // for hierarchical taxonomies, we can't assign a term when multiple terms in the hierarchy share the same name
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * For hierarchical taxonomies, we can't assign a term when multiple terms
+ * in the hierarchy share the same name.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> $ambiguous_terms = array();
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_taxonomy_hierarchical( $taxonomy ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $tax_term_names = get_terms( $taxonomy, array( 'fields' => 'names', 'hide_empty' => false ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // count the number of terms with the same name
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Count the number of terms with the same name.
</ins><span class="cx" style="display: block; padding: 0 10px"> $tax_term_names_count = array_count_values( $tax_term_names );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // filter out non-ambiguous term names
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Filter out non-ambiguous term names.
</ins><span class="cx" style="display: block; padding: 0 10px"> $ambiguous_tax_term_counts = array_filter( $tax_term_names_count, array( $this, '_is_greater_than_one') );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $ambiguous_terms = array_keys( $ambiguous_tax_term_counts );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1362,11 +1367,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $term = get_term_by( 'name', $term_name, $taxonomy );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $term ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // term doesn't exist, so check that the user is allowed to create new terms
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Term doesn't exist, so check that the user is allowed to create new terms.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! current_user_can( $post_type_taxonomies[$taxonomy]->cap->edit_terms ) )
</span><span class="cx" style="display: block; padding: 0 10px"> return new IXR_Error( 401, __( 'Sorry, you are not allowed to add a term to one of the given taxonomies.' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // create the new term
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Create the new term.
</ins><span class="cx" style="display: block; padding: 0 10px"> $term_info = wp_insert_term( $term_name, $taxonomy );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_wp_error( $term_info ) )
</span><span class="cx" style="display: block; padding: 0 10px"> return new IXR_Error( 500, $term_info->get_error_message() );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1382,7 +1387,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post_data['tax_input'] = $terms;
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $post_data['terms'], $post_data['terms_names'] );
</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">- // do not allow direct submission of 'tax_input', clients must use 'terms' and/or 'terms_names'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Do not allow direct submission of 'tax_input', clients must use 'terms' and/or 'terms_names'.
</ins><span class="cx" style="display: block; padding: 0 10px"> unset( $post_data['tax_input'], $post_data['post_category'], $post_data['tags_input'] );
</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">@@ -1395,7 +1400,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $post_data['post_format'] );
</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">- // Handle enclosures
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Handle enclosures.
</ins><span class="cx" style="display: block; padding: 0 10px"> $enclosure = isset( $post_data['enclosure'] ) ? $post_data['enclosure'] : null;
</span><span class="cx" style="display: block; padding: 0 10px"> $this->add_enclosure_if_new( $post_ID, $enclosure );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1432,13 +1437,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $args {
</span><span class="cx" style="display: block; padding: 0 10px"> * Method parameters, in this order:
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type int $blog_id (unused)
- * @type string $username
- * @type string $password
- * @type int $post_id
- * @type array $content_struct
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @type int $blog_id Blog ID (unused).
+ * @type string $username Username.
+ * @type string $password Password.
+ * @type int $post_id Post ID.
+ * @type array $content_struct Extra content arguments.
</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 true|IXR_Error true on success
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return true|IXR_Error True on success, IXR_Error on failure.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function wp_editPost( $args ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $this->minimum_args( $args, 5 ) )
</span></span></pre>
</div>
</div>
</body>
</html>