<!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>[27730] trunk/src/wp-includes/class-wp-xmlrpc-server.php: Inline documentation for hooks in wp-includes/class-wp-xmlrpc-server.php.</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">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/27730">27730</a></dd>
<dt>Author</dt> <dd>DrewAPicture</dd>
<dt>Date</dt> <dd>2014-03-26 05:43:05 +0000 (Wed, 26 Mar 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Inline documentation for hooks in wp-includes/class-wp-xmlrpc-server.php.
Props kpdesign and DrewAPicture.
Fixes <a href="http://core.trac.wordpress.org/ticket/27506">#27506</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>Modified: trunk/src/wp-includes/class-wp-xmlrpc-server.php (27729 => 27730)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/class-wp-xmlrpc-server.php 2014-03-26 02:07:23 UTC (rev 27729)
+++ trunk/src/wp-includes/class-wp-xmlrpc-server.php 2014-03-26 05:43:05 UTC (rev 27730)
</span><span class="lines">@@ -127,7 +127,17 @@
</span><span class="cx"> );
</span><span class="cx">
</span><span class="cx"> $this->initialise_blog_option_info();
</span><del>- $this->methods = apply_filters('xmlrpc_methods', $this->methods);
</del><ins>+
+ /**
+ * Filter the methods exposed by the XML-RPC server.
+ *
+ * This filter can be used to add new methods, and remove built-in methods.
+ *
+ * @since 1.5.0
+ *
+ * @param array $methods An array of XML-RPC methods.
+ */
+ $this->methods = apply_filters( 'xmlrpc_methods', $this->methods );
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function serve_request() {
</span><span class="lines">@@ -171,11 +181,37 @@
</span><span class="cx"> */
</span><span class="cx"> function login( $username, $password ) {
</span><span class="cx"> // Respect any old filters against get_option() for 'enable_xmlrpc'.
</span><del>- $enabled = apply_filters( 'pre_option_enable_xmlrpc', false ); // Deprecated
</del><ins>+
+ /**
+ * Filter whether XML-RPC is enabled.
+ *
+ * @since 3.5.0
+ * @deprecated 3.5.0 Use 'xmlrpc_enabled' instead.
+ *
+ * @param bool $enable Whether to enable XML-RPC. Default false.
+ */
+ $enabled = apply_filters( 'pre_option_enable_xmlrpc', false );
</ins><span class="cx"> if ( false === $enabled )
</span><del>- $enabled = apply_filters( 'option_enable_xmlrpc', true ); // Deprecated
</del><span class="cx">
</span><del>- // Proper filter for turning off XML-RPC. It is on by default.
</del><ins>+ /**
+ * Filter whether XML-RPC is enabled.
+ *
+ * @since 3.5.0
+ * @deprecated 3.5.0 Use 'xmlrpc_enabled' instead.
+ *
+ * @param bool $enable Whether to enable XML-RPC. Default true.
+ */
+ $enabled = apply_filters( 'option_enable_xmlrpc', true );
+
+ /**
+ * Filter whether XML-RPC is enabled.
+ *
+ * This is the proper filter for turning off XML-RPC.
+ *
+ * @since 3.5.0
+ *
+ * @param bool $enabled Whether XML-RPC is enabled. Default true.
+ */
</ins><span class="cx"> $enabled = apply_filters( 'xmlrpc_enabled', $enabled );
</span><span class="cx">
</span><span class="cx"> if ( ! $enabled ) {
</span><span class="lines">@@ -187,6 +223,15 @@
</span><span class="cx">
</span><span class="cx"> if (is_wp_error($user)) {
</span><span class="cx"> $this->error = new IXR_Error( 403, __( 'Incorrect username or password.' ) );
</span><ins>+
+ /**
+ * Filter the XML-RPC user login error message.
+ *
+ * @since 3.5.0
+ *
+ * @param string $error The XML-RPC error message.
+ * @param WP_User $user WP_User object.
+ */
</ins><span class="cx"> $this->error = apply_filters( 'xmlrpc_login_error', $this->error, $user );
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="lines">@@ -441,6 +486,13 @@
</span><span class="cx"> )
</span><span class="cx"> );
</span><span class="cx">
</span><ins>+ /**
+ * Filter the XML-RPC blog options property.
+ *
+ * @since 2.6.0
+ *
+ * @param array $blog_options An array of XML-RPC blog options.
+ */
</ins><span class="cx"> $this->blog_options = apply_filters( 'xmlrpc_blog_options', $this->blog_options );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -474,6 +526,17 @@
</span><span class="cx"> if ( !$user = $this->login($username, $password) )
</span><span class="cx"> return $this->error;
</span><span class="cx">
</span><ins>+ /**
+ * Fires after the XML-RPC user has been authenticated but before the rest of
+ * the method logic begins.
+ *
+ * All built-in XML-RPC methods use the action xmlrpc_call, with a parameter
+ * equal to the method's name, e.g., wp.getUsersBlogs, wp.newPost, etc.
+ *
+ * @since 2.5.0
+ *
+ * @param method $name The method name.
+ */
</ins><span class="cx"> do_action( 'xmlrpc_call', 'wp.getUsersBlogs' );
</span><span class="cx">
</span><span class="cx"> $blogs = (array) get_blogs_of_user( $user->ID );
</span><span class="lines">@@ -553,6 +616,15 @@
</span><span class="cx"> if ( in_array( 'object_type', $fields ) )
</span><span class="cx"> $_taxonomy['object_type'] = array_unique( (array) $taxonomy->object_type );
</span><span class="cx">
</span><ins>+ /**
+ * Filter XML-RPC-prepared data for the given taxonomy.
+ *
+ * @since 3.4.0
+ *
+ * @param array $_taxonomy An array of taxonomy data.
+ * @param object $taxonomy Taxonomy object.
+ * @param array $fields The subset of taxonomy fields to return.
+ */
</ins><span class="cx"> return apply_filters( 'xmlrpc_prepare_taxonomy', $_taxonomy, $taxonomy, $fields );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -578,6 +650,14 @@
</span><span class="cx"> // Count we are happy to return as an integer because people really shouldn't use terms that much.
</span><span class="cx"> $_term['count'] = intval( $_term['count'] );
</span><span class="cx">
</span><ins>+ /**
+ * Filter XML-RPC-prepared data for the given term.
+ *
+ * @since 3.4.0
+ *
+ * @param array $_term An array of term data.
+ * @param array|object $term Term object or array.
+ */
</ins><span class="cx"> return apply_filters( 'xmlrpc_prepare_term', $_term, $term );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -699,6 +779,15 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ /**
+ * Filter XML-RPC-prepared date for the given post.
+ *
+ * @since 3.4.0
+ *
+ * @param array $_post An array of modified post data.
+ * @param array $post An array of post data.
+ * @param array $fields An array of post fields.
+ */
</ins><span class="cx"> return apply_filters( 'xmlrpc_prepare_post', $_post, $post, $fields );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -741,6 +830,14 @@
</span><span class="cx"> if ( in_array( 'taxonomies', $fields ) )
</span><span class="cx"> $_post_type['taxonomies'] = get_object_taxonomies( $post_type->name, 'names' );
</span><span class="cx">
</span><ins>+ /**
+ * Filter XML-RPC-prepared date for the given post type.
+ *
+ * @since 3.4.0
+ *
+ * @param array $_post_type An array of post type data.
+ * @param object $post_type Post type object.
+ */
</ins><span class="cx"> return apply_filters( 'xmlrpc_prepare_post_type', $_post_type, $post_type );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -771,6 +868,15 @@
</span><span class="cx"> else
</span><span class="cx"> $_media_item['thumbnail'] = $_media_item['link'];
</span><span class="cx">
</span><ins>+ /**
+ * Filter XML-RPC-prepared data for the given media item.
+ *
+ * @since 3.4.0
+ *
+ * @param array $_media_item An array of media item data.
+ * @param object $media_item Media item object.
+ * @param string $thumbnail_size Image size.
+ */
</ins><span class="cx"> return apply_filters( 'xmlrpc_prepare_media_item', $_media_item, $media_item, $thumbnail_size );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -842,6 +948,14 @@
</span><span class="cx"> 'wp_page_template' => $page_template
</span><span class="cx"> );
</span><span class="cx">
</span><ins>+ /**
+ * Filter XML-RPC-prepared data for the given page.
+ *
+ * @since 3.4.0
+ *
+ * @param array $_page An array of page data.
+ * @param WP_Post $page Page object.
+ */
</ins><span class="cx"> return apply_filters( 'xmlrpc_prepare_page', $_page, $page );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -884,6 +998,14 @@
</span><span class="cx"> 'type' => $comment->comment_type,
</span><span class="cx"> );
</span><span class="cx">
</span><ins>+ /**
+ * Filter XML-RPC-prepared data for the given comment.
+ *
+ * @since 3.4.0
+ *
+ * @param array $_comment An array of prepared comment data.
+ * @param object $comment Comment object.
+ */
</ins><span class="cx"> return apply_filters( 'xmlrpc_prepare_comment', $_comment, $comment );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -924,6 +1046,15 @@
</span><span class="cx"> $_user = array_merge( $_user, $requested_fields );
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ /**
+ * Filter XML-RPC-prepared data for the given user.
+ *
+ * @since 3.5.0
+ *
+ * @param array $_user An array of user data.
+ * @param WP_User $user User object.
+ * @param array $fields An array of user fields.
+ */
</ins><span class="cx"> return apply_filters( 'xmlrpc_prepare_user', $_user, $user, $fields );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -972,6 +1103,7 @@
</span><span class="cx"> if ( ! $user = $this->login( $username, $password ) )
</span><span class="cx"> return $this->error;
</span><span class="cx">
</span><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
</ins><span class="cx"> do_action( 'xmlrpc_call', 'wp.newPost' );
</span><span class="cx">
</span><span class="cx"> unset( $content_struct['ID'] );
</span><span class="lines">@@ -1215,6 +1347,14 @@
</span><span class="cx">
</span><span class="cx"> $this->attach_uploads( $post_ID, $post_data['post_content'] );
</span><span class="cx">
</span><ins>+ /**
+ * Filter post data array to be inserted via XML-RPC.
+ *
+ * @since 3.4.0
+ *
+ * @param array $post_data Parsed array of post data.
+ * @param array $content_struct Post data array.
+ */
</ins><span class="cx"> $post_data = apply_filters( 'xmlrpc_wp_insert_post_data', $post_data, $content_struct );
</span><span class="cx">
</span><span class="cx"> $post_ID = $update ? wp_update_post( $post_data, true ) : wp_insert_post( $post_data, true );
</span><span class="lines">@@ -1258,6 +1398,7 @@
</span><span class="cx"> if ( ! $user = $this->login( $username, $password ) )
</span><span class="cx"> return $this->error;
</span><span class="cx">
</span><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
</ins><span class="cx"> do_action( 'xmlrpc_call', 'wp.editPost' );
</span><span class="cx">
</span><span class="cx"> $post = get_post( $post_id, ARRAY_A );
</span><span class="lines">@@ -1319,6 +1460,7 @@
</span><span class="cx"> if ( ! $user = $this->login( $username, $password ) )
</span><span class="cx"> return $this->error;
</span><span class="cx">
</span><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
</ins><span class="cx"> do_action( 'xmlrpc_call', 'wp.deletePost' );
</span><span class="cx">
</span><span class="cx"> $post = get_post( $post_id, ARRAY_A );
</span><span class="lines">@@ -1394,11 +1536,21 @@
</span><span class="cx"> if ( isset( $args[4] ) )
</span><span class="cx"> $fields = $args[4];
</span><span class="cx"> else
</span><ins>+
+ /**
+ * Filter the list of post query fields used by the given XML-RPC method.
+ *
+ * @since 3.4.0
+ *
+ * @param array $fields Array of post fields.
+ * @param string $method Method name.
+ */
</ins><span class="cx"> $fields = apply_filters( 'xmlrpc_default_post_fields', array( 'post', 'terms', 'custom_fields' ), 'wp.getPost' );
</span><span class="cx">
</span><span class="cx"> if ( ! $user = $this->login( $username, $password ) )
</span><span class="cx"> return $this->error;
</span><span class="cx">
</span><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
</ins><span class="cx"> do_action( 'xmlrpc_call', 'wp.getPost' );
</span><span class="cx">
</span><span class="cx"> $post = get_post( $post_id, ARRAY_A );
</span><span class="lines">@@ -1447,14 +1599,17 @@
</span><span class="cx"> $password = $args[2];
</span><span class="cx"> $filter = isset( $args[3] ) ? $args[3] : array();
</span><span class="cx">
</span><del>- if ( isset( $args[4] ) )
</del><ins>+ if ( isset( $args[4] ) ) {
</ins><span class="cx"> $fields = $args[4];
</span><del>- else
</del><ins>+ } else {
+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
</ins><span class="cx"> $fields = apply_filters( 'xmlrpc_default_post_fields', array( 'post', 'terms', 'custom_fields' ), 'wp.getPosts' );
</span><ins>+ }
</ins><span class="cx">
</span><span class="cx"> if ( ! $user = $this->login( $username, $password ) )
</span><span class="cx"> return $this->error;
</span><span class="cx">
</span><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
</ins><span class="cx"> do_action( 'xmlrpc_call', 'wp.getPosts' );
</span><span class="cx">
</span><span class="cx"> $query = array();
</span><span class="lines">@@ -1544,6 +1699,7 @@
</span><span class="cx"> if ( ! $user = $this->login( $username, $password ) )
</span><span class="cx"> return $this->error;
</span><span class="cx">
</span><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
</ins><span class="cx"> do_action( 'xmlrpc_call', 'wp.newTerm' );
</span><span class="cx">
</span><span class="cx"> if ( ! taxonomy_exists( $content_struct['taxonomy'] ) )
</span><span class="lines">@@ -1632,6 +1788,7 @@
</span><span class="cx"> if ( ! $user = $this->login( $username, $password ) )
</span><span class="cx"> return $this->error;
</span><span class="cx">
</span><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
</ins><span class="cx"> do_action( 'xmlrpc_call', 'wp.editTerm' );
</span><span class="cx">
</span><span class="cx"> if ( ! taxonomy_exists( $content_struct['taxonomy'] ) )
</span><span class="lines">@@ -1724,6 +1881,7 @@
</span><span class="cx"> if ( ! $user = $this->login( $username, $password ) )
</span><span class="cx"> return $this->error;
</span><span class="cx">
</span><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
</ins><span class="cx"> do_action( 'xmlrpc_call', 'wp.deleteTerm' );
</span><span class="cx">
</span><span class="cx"> if ( ! taxonomy_exists( $taxonomy ) )
</span><span class="lines">@@ -1791,6 +1949,7 @@
</span><span class="cx"> if ( ! $user = $this->login( $username, $password ) )
</span><span class="cx"> return $this->error;
</span><span class="cx">
</span><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
</ins><span class="cx"> do_action( 'xmlrpc_call', 'wp.getTerm' );
</span><span class="cx">
</span><span class="cx"> if ( ! taxonomy_exists( $taxonomy ) )
</span><span class="lines">@@ -1844,6 +2003,7 @@
</span><span class="cx"> if ( ! $user = $this->login( $username, $password ) )
</span><span class="cx"> return $this->error;
</span><span class="cx">
</span><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
</ins><span class="cx"> do_action( 'xmlrpc_call', 'wp.getTerms' );
</span><span class="cx">
</span><span class="cx"> if ( ! taxonomy_exists( $taxonomy ) )
</span><span class="lines">@@ -1915,14 +2075,24 @@
</span><span class="cx"> $password = $args[2];
</span><span class="cx"> $taxonomy = $args[3];
</span><span class="cx">
</span><del>- if ( isset( $args[4] ) )
</del><ins>+ if ( isset( $args[4] ) ) {
</ins><span class="cx"> $fields = $args[4];
</span><del>- else
</del><ins>+ } else {
+ /**
+ * Filter the taxonomy query fields used by the given XML-RPC method.
+ *
+ * @since 3.4.0
+ *
+ * @param array $fields An array of taxonomy fields to retrieve.
+ * @param string $method The method name.
+ */
</ins><span class="cx"> $fields = apply_filters( 'xmlrpc_default_taxonomy_fields', array( 'labels', 'cap', 'object_type' ), 'wp.getTaxonomy' );
</span><ins>+ }
</ins><span class="cx">
</span><span class="cx"> if ( ! $user = $this->login( $username, $password ) )
</span><span class="cx"> return $this->error;
</span><span class="cx">
</span><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
</ins><span class="cx"> do_action( 'xmlrpc_call', 'wp.getTaxonomy' );
</span><span class="cx">
</span><span class="cx"> if ( ! taxonomy_exists( $taxonomy ) )
</span><span class="lines">@@ -1959,14 +2129,17 @@
</span><span class="cx"> $password = $args[2];
</span><span class="cx"> $filter = isset( $args[3] ) ? $args[3] : array( 'public' => true );
</span><span class="cx">
</span><del>- if ( isset( $args[4] ) )
</del><ins>+ if ( isset( $args[4] ) ) {
</ins><span class="cx"> $fields = $args[4];
</span><del>- else
</del><ins>+ } else {
+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
</ins><span class="cx"> $fields = apply_filters( 'xmlrpc_default_taxonomy_fields', array( 'labels', 'cap', 'object_type' ), 'wp.getTaxonomies' );
</span><ins>+ }
</ins><span class="cx">
</span><span class="cx"> if ( ! $user = $this->login( $username, $password ) )
</span><span class="cx"> return $this->error;
</span><span class="cx">
</span><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
</ins><span class="cx"> do_action( 'xmlrpc_call', 'wp.getTaxonomies' );
</span><span class="cx">
</span><span class="cx"> $taxonomies = get_taxonomies( $filter, 'objects' );
</span><span class="lines">@@ -2028,14 +2201,24 @@
</span><span class="cx"> $password = $args[2];
</span><span class="cx"> $user_id = (int) $args[3];
</span><span class="cx">
</span><del>- if ( isset( $args[4] ) )
</del><ins>+ if ( isset( $args[4] ) ) {
</ins><span class="cx"> $fields = $args[4];
</span><del>- else
</del><ins>+ } else {
+ /**
+ * Filter the default user query fields used by the given XML-RPC method.
+ *
+ * @since 3.5.0
+ *
+ * @param array $fields User query fields for given method. Default 'all'.
+ * @param string $method The method name.
+ */
</ins><span class="cx"> $fields = apply_filters( 'xmlrpc_default_user_fields', array( 'all' ), 'wp.getUser' );
</span><ins>+ }
</ins><span class="cx">
</span><span class="cx"> if ( ! $user = $this->login( $username, $password ) )
</span><span class="cx"> return $this->error;
</span><span class="cx">
</span><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
</ins><span class="cx"> do_action( 'xmlrpc_call', 'wp.getUser' );
</span><span class="cx">
</span><span class="cx"> if ( ! current_user_can( 'edit_user', $user_id ) )
</span><span class="lines">@@ -2081,14 +2264,17 @@
</span><span class="cx"> $password = $args[2];
</span><span class="cx"> $filter = isset( $args[3] ) ? $args[3] : array();
</span><span class="cx">
</span><del>- if ( isset( $args[4] ) )
</del><ins>+ if ( isset( $args[4] ) ) {
</ins><span class="cx"> $fields = $args[4];
</span><del>- else
</del><ins>+ } else {
+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
</ins><span class="cx"> $fields = apply_filters( 'xmlrpc_default_user_fields', array( 'all' ), 'wp.getUsers' );
</span><ins>+ }
</ins><span class="cx">
</span><span class="cx"> if ( ! $user = $this->login( $username, $password ) )
</span><span class="cx"> return $this->error;
</span><span class="cx">
</span><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
</ins><span class="cx"> do_action( 'xmlrpc_call', 'wp.getUsers' );
</span><span class="cx">
</span><span class="cx"> if ( ! current_user_can( 'list_users' ) )
</span><span class="lines">@@ -2148,14 +2334,17 @@
</span><span class="cx"> $username = $args[1];
</span><span class="cx"> $password = $args[2];
</span><span class="cx">
</span><del>- if ( isset( $args[3] ) )
</del><ins>+ if ( isset( $args[3] ) ) {
</ins><span class="cx"> $fields = $args[3];
</span><del>- else
</del><ins>+ } else {
+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
</ins><span class="cx"> $fields = apply_filters( 'xmlrpc_default_user_fields', array( 'all' ), 'wp.getProfile' );
</span><ins>+ }
</ins><span class="cx">
</span><span class="cx"> if ( ! $user = $this->login( $username, $password ) )
</span><span class="cx"> return $this->error;
</span><span class="cx">
</span><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
</ins><span class="cx"> do_action( 'xmlrpc_call', 'wp.getProfile' );
</span><span class="cx">
</span><span class="cx"> if ( ! current_user_can( 'edit_user', $user->ID ) )
</span><span class="lines">@@ -2199,6 +2388,7 @@
</span><span class="cx"> if ( ! $user = $this->login( $username, $password ) )
</span><span class="cx"> return $this->error;
</span><span class="cx">
</span><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
</ins><span class="cx"> do_action( 'xmlrpc_call', 'wp.editProfile' );
</span><span class="cx">
</span><span class="cx"> if ( ! current_user_can( 'edit_user', $user->ID ) )
</span><span class="lines">@@ -2272,7 +2462,8 @@
</span><span class="cx"> if ( !current_user_can( 'edit_page', $page_id ) )
</span><span class="cx"> return new IXR_Error( 401, __( 'Sorry, you cannot edit this page.' ) );
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'wp.getPage');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'wp.getPage' );
</ins><span class="cx">
</span><span class="cx"> // If we found the page then format the data.
</span><span class="cx"> if ( $page->ID && ($page->post_type == 'page') ) {
</span><span class="lines">@@ -2310,7 +2501,8 @@
</span><span class="cx"> if ( !current_user_can( 'edit_pages' ) )
</span><span class="cx"> return new IXR_Error( 401, __( 'Sorry, you cannot edit pages.' ) );
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'wp.getPages');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'wp.getPages' );
</ins><span class="cx">
</span><span class="cx"> $pages = get_posts( array('post_type' => 'page', 'post_status' => 'any', 'numberposts' => $num_pages) );
</span><span class="cx"> $num_pages = count($pages);
</span><span class="lines">@@ -2350,7 +2542,8 @@
</span><span class="cx"> if ( !$user = $this->login($username, $password) )
</span><span class="cx"> return $this->error;
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'wp.newPage');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'wp.newPage' );
</ins><span class="cx">
</span><span class="cx"> // Mark this as content for a page.
</span><span class="cx"> $args[3]["post_type"] = 'page';
</span><span class="lines">@@ -2378,7 +2571,8 @@
</span><span class="cx"> if ( !$user = $this->login($username, $password) )
</span><span class="cx"> return $this->error;
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'wp.deletePage');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'wp.deletePage' );
</ins><span class="cx">
</span><span class="cx"> // Get the current page based on the page_id and
</span><span class="cx"> // make sure it is a page and not a post.
</span><span class="lines">@@ -2395,6 +2589,14 @@
</span><span class="cx"> if ( !$result )
</span><span class="cx"> return(new IXR_Error(500, __('Failed to delete the page.')));
</span><span class="cx">
</span><ins>+ /**
+ * Fires after a page has been successfully deleted via XML-RPC.
+ *
+ * @since 3.4.0
+ *
+ * @param int $page_id ID of the deleted page.
+ * @param array $args An array of arguments to delete the page.
+ */
</ins><span class="cx"> do_action( 'xmlrpc_call_success_wp_deletePage', $page_id, $args );
</span><span class="cx">
</span><span class="cx"> return(true);
</span><span class="lines">@@ -2420,7 +2622,8 @@
</span><span class="cx"> if ( !$user = $this->login($username, $password) )
</span><span class="cx"> return $this->error;
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'wp.editPage');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'wp.editPage' );
</ins><span class="cx">
</span><span class="cx"> // Get the page data and make sure it is a page.
</span><span class="cx"> $actual_page = get_post($page_id, ARRAY_A);
</span><span class="lines">@@ -2470,7 +2673,8 @@
</span><span class="cx"> if ( !current_user_can( 'edit_pages' ) )
</span><span class="cx"> return new IXR_Error( 401, __( 'Sorry, you cannot edit pages.' ) );
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'wp.getPageList');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'wp.getPageList' );
</ins><span class="cx">
</span><span class="cx"> // Get list of pages ids and titles
</span><span class="cx"> $page_list = $wpdb->get_results("
</span><span class="lines">@@ -2521,7 +2725,8 @@
</span><span class="cx"> if ( !current_user_can('edit_posts') )
</span><span class="cx"> return(new IXR_Error(401, __('Sorry, you cannot edit posts on this site.')));
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'wp.getAuthors');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'wp.getAuthors' );
</ins><span class="cx">
</span><span class="cx"> $authors = array();
</span><span class="cx"> foreach ( get_users( array( 'fields' => array('ID','user_login','display_name') ) ) as $user ) {
</span><span class="lines">@@ -2556,6 +2761,7 @@
</span><span class="cx"> if ( !current_user_can( 'edit_posts' ) )
</span><span class="cx"> return new IXR_Error( 401, __( 'Sorry, you must be able to edit posts on this site in order to view tags.' ) );
</span><span class="cx">
</span><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
</ins><span class="cx"> do_action( 'xmlrpc_call', 'wp.getKeywords' );
</span><span class="cx">
</span><span class="cx"> $tags = array();
</span><span class="lines">@@ -2595,7 +2801,8 @@
</span><span class="cx"> if ( !$user = $this->login($username, $password) )
</span><span class="cx"> return $this->error;
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'wp.newCategory');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'wp.newCategory' );
</ins><span class="cx">
</span><span class="cx"> // Make sure the user is allowed to add a category.
</span><span class="cx"> if ( !current_user_can('manage_categories') )
</span><span class="lines">@@ -2632,6 +2839,14 @@
</span><span class="cx"> return(new IXR_Error(500, __('Sorry, the new category failed.')));
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ /**
+ * Fires after a new category has been successfully created via XML-RPC.
+ *
+ * @since 3.4.0
+ *
+ * @param int $cat_id ID of the new category.
+ * @param array $args An array of new category arguments.
+ */
</ins><span class="cx"> do_action( 'xmlrpc_call_success_wp_newCategory', $cat_id, $args );
</span><span class="cx">
</span><span class="cx"> return $cat_id;
</span><span class="lines">@@ -2656,15 +2871,25 @@
</span><span class="cx"> if ( !$user = $this->login($username, $password) )
</span><span class="cx"> return $this->error;
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'wp.deleteCategory');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'wp.deleteCategory' );
</ins><span class="cx">
</span><span class="cx"> if ( !current_user_can('manage_categories') )
</span><span class="cx"> return new IXR_Error( 401, __( 'Sorry, you do not have the right to delete a category.' ) );
</span><span class="cx">
</span><span class="cx"> $status = wp_delete_term( $category_id, 'category' );
</span><span class="cx">
</span><del>- if( true == $status )
</del><ins>+ if ( true == $status ) {
+ /**
+ * Fires after a category has been successfully deleted via XML-RPC.
+ *
+ * @since 3.4.0
+ *
+ * @param int $category_id ID of the deleted category.
+ * @param array $args An array of arguments to delete the category.
+ */
</ins><span class="cx"> do_action( 'xmlrpc_call_success_wp_deleteCategory', $category_id, $args );
</span><ins>+ }
</ins><span class="cx">
</span><span class="cx"> return $status;
</span><span class="cx"> }
</span><span class="lines">@@ -2692,7 +2917,8 @@
</span><span class="cx"> if ( !current_user_can( 'edit_posts' ) )
</span><span class="cx"> return new IXR_Error( 401, __( 'Sorry, you must be able to edit posts to this site in order to view categories.' ) );
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'wp.suggestCategories');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'wp.suggestCategories' );
</ins><span class="cx">
</span><span class="cx"> $category_suggestions = array();
</span><span class="cx"> $args = array('get' => 'all', 'number' => $max_results, 'name__like' => $category);
</span><span class="lines">@@ -2728,7 +2954,8 @@
</span><span class="cx"> if ( !current_user_can( 'moderate_comments' ) )
</span><span class="cx"> return new IXR_Error( 403, __( 'You are not allowed to moderate comments on this site.' ) );
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'wp.getComment');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'wp.getComment' );
</ins><span class="cx">
</span><span class="cx"> if ( ! $comment = get_comment($comment_id) )
</span><span class="cx"> return new IXR_Error( 404, __( 'Invalid comment ID.' ) );
</span><span class="lines">@@ -2769,7 +2996,8 @@
</span><span class="cx"> if ( !current_user_can( 'moderate_comments' ) )
</span><span class="cx"> return new IXR_Error( 401, __( 'Sorry, you cannot edit comments.' ) );
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'wp.getComments');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'wp.getComments' );
</ins><span class="cx">
</span><span class="cx"> if ( isset($struct['status']) )
</span><span class="cx"> $status = $struct['status'];
</span><span class="lines">@@ -2835,12 +3063,22 @@
</span><span class="cx"> if ( !current_user_can( 'edit_comment', $comment_ID ) )
</span><span class="cx"> return new IXR_Error( 403, __( 'You are not allowed to moderate comments on this site.' ) );
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'wp.deleteComment');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'wp.deleteComment' );
</ins><span class="cx">
</span><span class="cx"> $status = wp_delete_comment( $comment_ID );
</span><span class="cx">
</span><del>- if( true == $status )
</del><ins>+ if ( true == $status ) {
+ /**
+ * Fires after a comment has been successfully deleted via XML-RPC.
+ *
+ * @since 3.4.0
+ *
+ * @param int $comment_ID ID of the deleted comment.
+ * @param array $args An array of arguments to delete the comment.
+ */
</ins><span class="cx"> do_action( 'xmlrpc_call_success_wp_deleteComment', $comment_ID, $args );
</span><ins>+ }
</ins><span class="cx">
</span><span class="cx"> return $status;
</span><span class="cx"> }
</span><span class="lines">@@ -2890,7 +3128,8 @@
</span><span class="cx"> if ( !current_user_can( 'edit_comment', $comment_ID ) )
</span><span class="cx"> return new IXR_Error( 403, __( 'You are not allowed to moderate comments on this site.' ) );
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'wp.editComment');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'wp.editComment' );
</ins><span class="cx">
</span><span class="cx"> if ( isset($content_struct['status']) ) {
</span><span class="cx"> $statuses = get_comment_statuses();
</span><span class="lines">@@ -2931,6 +3170,14 @@
</span><span class="cx"> if ( !$result )
</span><span class="cx"> return new IXR_Error(500, __('Sorry, the comment could not be edited. Something wrong happened.'));
</span><span class="cx">
</span><ins>+ /**
+ * Fires after a comment has been successfully updated via XML-RPC.
+ *
+ * @since 3.4.0
+ *
+ * @param int $comment_ID ID of the updated comment.
+ * @param array $args An array of arguments to update the comment.
+ */
</ins><span class="cx"> do_action( 'xmlrpc_call_success_wp_editComment', $comment_ID, $args );
</span><span class="cx">
</span><span class="cx"> return true;
</span><span class="lines">@@ -2955,7 +3202,15 @@
</span><span class="cx"> $post = $args[3];
</span><span class="cx"> $content_struct = $args[4];
</span><span class="cx">
</span><del>- $allow_anon = apply_filters('xmlrpc_allow_anonymous_comments', false);
</del><ins>+ /**
+ * Filter whether to allow anonymous comments over XML-RPC.
+ *
+ * @since 2.7.0
+ *
+ * @param bool $allow Whether to allow anonymous commenting via XML-RPC.
+ * Default false.
+ */
+ $allow_anon = apply_filters( 'xmlrpc_allow_anonymous_comments', false );
</ins><span class="cx">
</span><span class="cx"> $user = $this->login($username, $password);
</span><span class="cx">
</span><span class="lines">@@ -3014,10 +3269,19 @@
</span><span class="cx">
</span><span class="cx"> $comment['comment_content'] = isset($content_struct['content']) ? $content_struct['content'] : null;
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'wp.newComment');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'wp.newComment' );
</ins><span class="cx">
</span><span class="cx"> $comment_ID = wp_new_comment( $comment );
</span><span class="cx">
</span><ins>+ /**
+ * Fires after a new comment has been successfully created via XML-RPC.
+ *
+ * @since 3.4.0
+ *
+ * @param int $comment_ID ID of the new comment.
+ * @param array $args An array of new comment arguments.
+ */
</ins><span class="cx"> do_action( 'xmlrpc_call_success_wp_newComment', $comment_ID, $args );
</span><span class="cx">
</span><span class="cx"> return $comment_ID;
</span><span class="lines">@@ -3044,7 +3308,8 @@
</span><span class="cx"> if ( !current_user_can( 'moderate_comments' ) )
</span><span class="cx"> return new IXR_Error( 403, __( 'You are not allowed access to details about this site.' ) );
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'wp.getCommentStatusList');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'wp.getCommentStatusList' );
</ins><span class="cx">
</span><span class="cx"> return get_comment_statuses();
</span><span class="cx"> }
</span><span class="lines">@@ -3071,7 +3336,8 @@
</span><span class="cx"> if ( !current_user_can( 'edit_posts' ) )
</span><span class="cx"> return new IXR_Error( 403, __( 'You are not allowed access to details about comments.' ) );
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'wp.getCommentCount');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'wp.getCommentCount' );
</ins><span class="cx">
</span><span class="cx"> $count = wp_count_comments( $post_id );
</span><span class="cx"> return array(
</span><span class="lines">@@ -3103,7 +3369,8 @@
</span><span class="cx"> if ( !current_user_can( 'edit_posts' ) )
</span><span class="cx"> return new IXR_Error( 403, __( 'You are not allowed access to details about this site.' ) );
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'wp.getPostStatusList');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'wp.getPostStatusList' );
</ins><span class="cx">
</span><span class="cx"> return get_post_statuses();
</span><span class="cx"> }
</span><span class="lines">@@ -3129,7 +3396,8 @@
</span><span class="cx"> if ( !current_user_can( 'edit_pages' ) )
</span><span class="cx"> return new IXR_Error( 403, __( 'You are not allowed access to details about this site.' ) );
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'wp.getPageStatusList');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'wp.getPageStatusList' );
</ins><span class="cx">
</span><span class="cx"> return get_page_statuses();
</span><span class="cx"> }
</span><span class="lines">@@ -3286,7 +3554,8 @@
</span><span class="cx"> if ( !current_user_can( 'upload_files' ) )
</span><span class="cx"> return new IXR_Error( 403, __( 'You do not have permission to upload files.' ) );
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'wp.getMediaItem');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'wp.getMediaItem' );
</ins><span class="cx">
</span><span class="cx"> if ( ! $attachment = get_post($attachment_id) )
</span><span class="cx"> return new IXR_Error( 404, __( 'Invalid attachment ID.' ) );
</span><span class="lines">@@ -3331,7 +3600,8 @@
</span><span class="cx"> if ( !current_user_can( 'upload_files' ) )
</span><span class="cx"> return new IXR_Error( 401, __( 'You do not have permission to upload files.' ) );
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'wp.getMediaLibrary');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'wp.getMediaLibrary' );
</ins><span class="cx">
</span><span class="cx"> $parent_id = ( isset($struct['parent_id']) ) ? absint($struct['parent_id']) : '' ;
</span><span class="cx"> $mime_type = ( isset($struct['mime_type']) ) ? $struct['mime_type'] : '' ;
</span><span class="lines">@@ -3372,6 +3642,7 @@
</span><span class="cx"> if ( !current_user_can( 'edit_posts' ) )
</span><span class="cx"> return new IXR_Error( 403, __( 'You are not allowed access to details about this site.' ) );
</span><span class="cx">
</span><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
</ins><span class="cx"> do_action( 'xmlrpc_call', 'wp.getPostFormats' );
</span><span class="cx">
</span><span class="cx"> $formats = get_post_format_strings();
</span><span class="lines">@@ -3427,14 +3698,24 @@
</span><span class="cx"> $password = $args[2];
</span><span class="cx"> $post_type_name = $args[3];
</span><span class="cx">
</span><del>- if ( isset( $args[4] ) )
</del><ins>+ if ( isset( $args[4] ) ) {
</ins><span class="cx"> $fields = $args[4];
</span><del>- else
</del><ins>+ } else {
+ /**
+ * Filter the default query fields used by the given XML-RPC method.
+ *
+ * @since 3.4.0
+ *
+ * @param array $fields An array of post type query fields for the given method.
+ * @param string $method The method name.
+ */
</ins><span class="cx"> $fields = apply_filters( 'xmlrpc_default_posttype_fields', array( 'labels', 'cap', 'taxonomies' ), 'wp.getPostType' );
</span><ins>+ }
</ins><span class="cx">
</span><span class="cx"> if ( !$user = $this->login( $username, $password ) )
</span><span class="cx"> return $this->error;
</span><span class="cx">
</span><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
</ins><span class="cx"> do_action( 'xmlrpc_call', 'wp.getPostType' );
</span><span class="cx">
</span><span class="cx"> if( ! post_type_exists( $post_type_name ) )
</span><span class="lines">@@ -3473,14 +3754,17 @@
</span><span class="cx"> $password = $args[2];
</span><span class="cx"> $filter = isset( $args[3] ) ? $args[3] : array( 'public' => true );
</span><span class="cx">
</span><del>- if ( isset( $args[4] ) )
</del><ins>+ if ( isset( $args[4] ) ) {
</ins><span class="cx"> $fields = $args[4];
</span><del>- else
</del><ins>+ } else {
+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
</ins><span class="cx"> $fields = apply_filters( 'xmlrpc_default_posttype_fields', array( 'labels', 'cap', 'taxonomies' ), 'wp.getPostTypes' );
</span><ins>+ }
</ins><span class="cx">
</span><span class="cx"> if ( ! $user = $this->login( $username, $password ) )
</span><span class="cx"> return $this->error;
</span><span class="cx">
</span><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
</ins><span class="cx"> do_action( 'xmlrpc_call', 'wp.getPostTypes' );
</span><span class="cx">
</span><span class="cx"> $post_types = get_post_types( $filter, 'objects' );
</span><span class="lines">@@ -3527,14 +3811,24 @@
</span><span class="cx"> $password = $args[2];
</span><span class="cx"> $post_id = (int) $args[3];
</span><span class="cx">
</span><del>- if ( isset( $args[4] ) )
</del><ins>+ if ( isset( $args[4] ) ) {
</ins><span class="cx"> $fields = $args[4];
</span><del>- else
</del><ins>+ } else {
+ /**
+ * Filter the default revision query fields used by the given XML-RPC method.
+ *
+ * @since 3.5.0
+ *
+ * @param array $field An array of revision query fields.
+ * @param string $method The method name.
+ */
</ins><span class="cx"> $fields = apply_filters( 'xmlrpc_default_revision_fields', array( 'post_date', 'post_date_gmt' ), 'wp.getRevisions' );
</span><ins>+ }
</ins><span class="cx">
</span><span class="cx"> if ( ! $user = $this->login( $username, $password ) )
</span><span class="cx"> return $this->error;
</span><span class="cx">
</span><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
</ins><span class="cx"> do_action( 'xmlrpc_call', 'wp.getRevisions' );
</span><span class="cx">
</span><span class="cx"> if ( ! $post = get_post( $post_id ) )
</span><span class="lines">@@ -3596,6 +3890,7 @@
</span><span class="cx"> if ( ! $user = $this->login( $username, $password ) )
</span><span class="cx"> return $this->error;
</span><span class="cx">
</span><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
</ins><span class="cx"> do_action( 'xmlrpc_call', 'wp.restoreRevision' );
</span><span class="cx">
</span><span class="cx"> if ( ! $revision = wp_get_post_revision( $revision_id ) )
</span><span class="lines">@@ -3645,7 +3940,8 @@
</span><span class="cx"> if ( !$user = $this->login($username, $password) )
</span><span class="cx"> return $this->error;
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'blogger.getUsersBlogs');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'blogger.getUsersBlogs' );
</ins><span class="cx">
</span><span class="cx"> $is_admin = current_user_can('manage_options');
</span><span class="cx">
</span><span class="lines">@@ -3712,7 +4008,8 @@
</span><span class="cx"> if ( !current_user_can( 'edit_posts' ) )
</span><span class="cx"> return new IXR_Error( 401, __( 'Sorry, you do not have access to user data on this site.' ) );
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'blogger.getUserInfo');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'blogger.getUserInfo' );
</ins><span class="cx">
</span><span class="cx"> $struct = array(
</span><span class="cx"> 'nickname' => $user->nickname,
</span><span class="lines">@@ -3751,7 +4048,8 @@
</span><span class="cx"> if ( !current_user_can( 'edit_post', $post_ID ) )
</span><span class="cx"> return new IXR_Error( 401, __( 'Sorry, you cannot edit this post.' ) );
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'blogger.getPost');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'blogger.getPost' );
</ins><span class="cx">
</span><span class="cx"> $categories = implode(',', wp_get_post_categories($post_ID));
</span><span class="cx">
</span><span class="lines">@@ -3796,7 +4094,8 @@
</span><span class="cx"> if ( ! current_user_can( 'edit_posts' ) )
</span><span class="cx"> return new IXR_Error( 401, __( 'Sorry, you cannot edit posts on this site.' ) );
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'blogger.getRecentPosts');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'blogger.getRecentPosts' );
</ins><span class="cx">
</span><span class="cx"> $posts_list = wp_get_recent_posts( $query );
</span><span class="cx">
</span><span class="lines">@@ -3874,7 +4173,8 @@
</span><span class="cx"> if ( !$user = $this->login($username, $password) )
</span><span class="cx"> return $this->error;
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'blogger.newPost');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'blogger.newPost' );
</ins><span class="cx">
</span><span class="cx"> $cap = ($publish) ? 'publish_posts' : 'edit_posts';
</span><span class="cx"> if ( ! current_user_can( get_post_type_object( 'post' )->cap->create_posts ) || !current_user_can($cap) )
</span><span class="lines">@@ -3902,6 +4202,14 @@
</span><span class="cx">
</span><span class="cx"> $this->attach_uploads( $post_ID, $post_content );
</span><span class="cx">
</span><ins>+ /**
+ * Fires after a new post has been successfully created via the XML-RPC Blogger API.
+ *
+ * @since 3.4.0
+ *
+ * @param int $post_ID ID of the new post.
+ * @param array $args An array of new post arguments.
+ */
</ins><span class="cx"> do_action( 'xmlrpc_call_success_blogger_newPost', $post_ID, $args );
</span><span class="cx">
</span><span class="cx"> return $post_ID;
</span><span class="lines">@@ -3928,7 +4236,8 @@
</span><span class="cx"> if ( !$user = $this->login($username, $password) )
</span><span class="cx"> return $this->error;
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'blogger.editPost');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'blogger.editPost' );
</ins><span class="cx">
</span><span class="cx"> $actual_post = get_post($post_ID,ARRAY_A);
</span><span class="cx">
</span><span class="lines">@@ -3958,6 +4267,14 @@
</span><span class="cx">
</span><span class="cx"> $this->attach_uploads( $ID, $post_content );
</span><span class="cx">
</span><ins>+ /**
+ * Fires after a post has been successfully updated via the XML-RPC Blogger API.
+ *
+ * @since 3.4.0
+ *
+ * @param int $post_ID ID of the updated post.
+ * @param array $args An array of arguments for the post to edit.
+ */
</ins><span class="cx"> do_action( 'xmlrpc_call_success_blogger_editPost', $post_ID, $args );
</span><span class="cx">
</span><span class="cx"> return true;
</span><span class="lines">@@ -3982,7 +4299,8 @@
</span><span class="cx"> if ( !$user = $this->login($username, $password) )
</span><span class="cx"> return $this->error;
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'blogger.deletePost');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'blogger.deletePost' );
</ins><span class="cx">
</span><span class="cx"> $actual_post = get_post($post_ID,ARRAY_A);
</span><span class="cx">
</span><span class="lines">@@ -3997,6 +4315,14 @@
</span><span class="cx"> if ( !$result )
</span><span class="cx"> return new IXR_Error(500, __('For some strange yet very annoying reason, this post could not be deleted.'));
</span><span class="cx">
</span><ins>+ /**
+ * Fires after a post has been successfully deleted via the XML-RPC Blogger API.
+ *
+ * @since 3.4.0
+ *
+ * @param int $post_ID ID of the deleted post.
+ * @param array $args An array of arguments to delete the post.
+ */
</ins><span class="cx"> do_action( 'xmlrpc_call_success_blogger_deletePost', $post_ID, $args );
</span><span class="cx">
</span><span class="cx"> return true;
</span><span class="lines">@@ -4053,7 +4379,8 @@
</span><span class="cx"> if ( !$user = $this->login($username, $password) )
</span><span class="cx"> return $this->error;
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'metaWeblog.newPost');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'metaWeblog.newPost' );
</ins><span class="cx">
</span><span class="cx"> $page_template = '';
</span><span class="cx"> if ( !empty( $content_struct['post_type'] ) ) {
</span><span class="lines">@@ -4307,6 +4634,14 @@
</span><span class="cx"> if ( !$post_ID )
</span><span class="cx"> return new IXR_Error(500, __('Sorry, your entry could not be posted. Something wrong happened.'));
</span><span class="cx">
</span><ins>+ /**
+ * Fires after a new post has been successfully created via the XML-RPC MovableType API.
+ *
+ * @since 3.4.0
+ *
+ * @param int $post_ID ID of the new post.
+ * @param array $args An array of arguments to create the new post.
+ */
</ins><span class="cx"> do_action( 'xmlrpc_call_success_mw_newPost', $post_ID, $args );
</span><span class="cx">
</span><span class="cx"> return strval($post_ID);
</span><span class="lines">@@ -4372,7 +4707,8 @@
</span><span class="cx"> if ( ! $user = $this->login($username, $password) )
</span><span class="cx"> return $this->error;
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'metaWeblog.editPost');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'metaWeblog.editPost' );
</ins><span class="cx">
</span><span class="cx"> $postdata = get_post( $post_ID, ARRAY_A );
</span><span class="cx">
</span><span class="lines">@@ -4615,6 +4951,14 @@
</span><span class="cx"> if ( isset( $content_struct['wp_post_format'] ) )
</span><span class="cx"> set_post_format( $post_ID, $content_struct['wp_post_format'] );
</span><span class="cx">
</span><ins>+ /**
+ * Fires after a post has been successfully updated via the XML-RPC MovableType API.
+ *
+ * @since 3.4.0
+ *
+ * @param int $post_ID ID of the updated post.
+ * @param array $args An array of arguments to update the post.
+ */
</ins><span class="cx"> do_action( 'xmlrpc_call_success_mw_editPost', $post_ID, $args );
</span><span class="cx">
</span><span class="cx"> return true;
</span><span class="lines">@@ -4646,7 +4990,8 @@
</span><span class="cx"> if ( !current_user_can( 'edit_post', $post_ID ) )
</span><span class="cx"> return new IXR_Error( 401, __( 'Sorry, you cannot edit this post.' ) );
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'metaWeblog.getPost');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'metaWeblog.getPost' );
</ins><span class="cx">
</span><span class="cx"> if ($postdata['post_date'] != '') {
</span><span class="cx"> $post_date = $this->_convert_date( $postdata['post_date'] );
</span><span class="lines">@@ -4770,7 +5115,8 @@
</span><span class="cx"> if ( ! current_user_can( 'edit_posts' ) )
</span><span class="cx"> return new IXR_Error( 401, __( 'Sorry, you cannot edit posts on this site.' ) );
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'metaWeblog.getRecentPosts');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'metaWeblog.getRecentPosts' );
</ins><span class="cx">
</span><span class="cx"> $posts_list = wp_get_recent_posts( $query );
</span><span class="cx">
</span><span class="lines">@@ -4885,7 +5231,8 @@
</span><span class="cx"> if ( !current_user_can( 'edit_posts' ) )
</span><span class="cx"> return new IXR_Error( 401, __( 'Sorry, you must be able to edit posts on this site in order to view categories.' ) );
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'metaWeblog.getCategories');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'metaWeblog.getCategories' );
</ins><span class="cx">
</span><span class="cx"> $categories_struct = array();
</span><span class="cx">
</span><span class="lines">@@ -4933,15 +5280,27 @@
</span><span class="cx"> if ( !$user = $this->login($username, $password) )
</span><span class="cx"> return $this->error;
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'metaWeblog.newMediaObject');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'metaWeblog.newMediaObject' );
</ins><span class="cx">
</span><span class="cx"> if ( !current_user_can('upload_files') ) {
</span><span class="cx"> $this->error = new IXR_Error( 401, __( 'You do not have permission to upload files.' ) );
</span><span class="cx"> return $this->error;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if ( $upload_err = apply_filters( 'pre_upload_error', false ) )
- return new IXR_Error(500, $upload_err);
</del><ins>+ /**
+ * Filter whether to preempt the XML-RPC media upload.
+ *
+ * Passing a truthy value will effectively short-circuit the media upload,
+ * returning that value as a 500 error instead.
+ *
+ * @since 2.1.0
+ *
+ * @param bool $error Whether to pre-empt the media upload. Default false.
+ */
+ if ( $upload_err = apply_filters( 'pre_upload_error', false ) ) {
+ return new IXR_Error( 500, $upload_err );
+ }
</ins><span class="cx">
</span><span class="cx"> if ( !empty($data['overwrite']) && ($data['overwrite'] == true) ) {
</span><span class="cx"> // Get postmeta info on the object.
</span><span class="lines">@@ -4987,6 +5346,14 @@
</span><span class="cx"> $id = wp_insert_attachment( $attachment, $upload[ 'file' ], $post_id );
</span><span class="cx"> wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $upload['file'] ) );
</span><span class="cx">
</span><ins>+ /**
+ * Fires after a new attachment has been added via the XML-RPC MovableType API.
+ *
+ * @since 3.4.0
+ *
+ * @param int $id ID of the new attachment.
+ * @param array $args An array of arguments to add the attachment.
+ */
</ins><span class="cx"> do_action( 'xmlrpc_call_success_mw_newMediaObject', $id, $args );
</span><span class="cx">
</span><span class="cx"> $struct = array(
</span><span class="lines">@@ -5027,7 +5394,8 @@
</span><span class="cx"> if ( !$user = $this->login($username, $password) )
</span><span class="cx"> return $this->error;
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'mt.getRecentPostTitles');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'mt.getRecentPostTitles' );
</ins><span class="cx">
</span><span class="cx"> $posts_list = wp_get_recent_posts( $query );
</span><span class="cx">
</span><span class="lines">@@ -5086,7 +5454,8 @@
</span><span class="cx"> if ( !current_user_can( 'edit_posts' ) )
</span><span class="cx"> return new IXR_Error( 401, __( 'Sorry, you must be able to edit posts on this site in order to view categories.' ) );
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'mt.getCategoryList');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'mt.getCategoryList' );
</ins><span class="cx">
</span><span class="cx"> $categories_struct = array();
</span><span class="cx">
</span><span class="lines">@@ -5127,7 +5496,8 @@
</span><span class="cx"> if ( !current_user_can( 'edit_post', $post_ID ) )
</span><span class="cx"> return new IXR_Error( 401, __( 'Sorry, you can not edit this post.' ) );
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'mt.getPostCategories');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'mt.getPostCategories' );
</ins><span class="cx">
</span><span class="cx"> $categories = array();
</span><span class="cx"> $catids = wp_get_post_categories(intval($post_ID));
</span><span class="lines">@@ -5165,7 +5535,8 @@
</span><span class="cx"> if ( !$user = $this->login($username, $password) )
</span><span class="cx"> return $this->error;
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'mt.setPostCategories');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'mt.setPostCategories' );
</ins><span class="cx">
</span><span class="cx"> if ( ! get_post( $post_ID ) )
</span><span class="cx"> return new IXR_Error( 404, __( 'Invalid post ID.' ) );
</span><span class="lines">@@ -5193,7 +5564,8 @@
</span><span class="cx"> */
</span><span class="cx"> function mt_supportedMethods($args) {
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'mt.supportedMethods');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'mt.supportedMethods' );
</ins><span class="cx">
</span><span class="cx"> $supported_methods = array();
</span><span class="cx"> foreach ( $this->methods as $key => $value ) {
</span><span class="lines">@@ -5211,8 +5583,17 @@
</span><span class="cx"> * @param array $args Method parameters.
</span><span class="cx"> */
</span><span class="cx"> function mt_supportedTextFilters($args) {
</span><del>- do_action('xmlrpc_call', 'mt.supportedTextFilters');
- return apply_filters('xmlrpc_text_filters', array());
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'mt.supportedTextFilters' );
+
+ /**
+ * Filter the MoveableType text filters list for XML-RPC.
+ *
+ * @since 2.2.0
+ *
+ * @param array $filters An array of text filters.
+ */
+ return apply_filters( 'xmlrpc_text_filters', array() );
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><span class="lines">@@ -5229,7 +5610,8 @@
</span><span class="cx">
</span><span class="cx"> $post_ID = intval($args);
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'mt.getTrackbackPings');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'mt.getTrackbackPings' );
</ins><span class="cx">
</span><span class="cx"> $actual_post = get_post($post_ID, ARRAY_A);
</span><span class="cx">
</span><span class="lines">@@ -5276,7 +5658,8 @@
</span><span class="cx"> if ( !$user = $this->login($username, $password) )
</span><span class="cx"> return $this->error;
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'mt.publishPost');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'mt.publishPost' );
</ins><span class="cx">
</span><span class="cx"> $postdata = get_post($post_ID, ARRAY_A);
</span><span class="cx"> if ( ! $postdata )
</span><span class="lines">@@ -5312,7 +5695,8 @@
</span><span class="cx"> function pingback_ping($args) {
</span><span class="cx"> global $wpdb;
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'pingback.ping');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'pingback.ping' );
</ins><span class="cx">
</span><span class="cx"> $this->escape($args);
</span><span class="cx">
</span><span class="lines">@@ -5325,7 +5709,16 @@
</span><span class="cx"> $pagelinkedto = str_replace('&', '&', $pagelinkedto);
</span><span class="cx"> $pagelinkedto = str_replace('&', '&', $pagelinkedto);
</span><span class="cx">
</span><ins>+ /**
+ * Filter the pingback source URI.
+ *
+ * @since 3.6.0
+ *
+ * @param string $pagelinkedfrom URI of the page linked from.
+ * @param string $pagelinkedto URI of the page linked to.
+ */
</ins><span class="cx"> $pagelinkedfrom = apply_filters( 'pingback_ping_source_uri', $pagelinkedfrom, $pagelinkedto );
</span><ins>+
</ins><span class="cx"> if ( ! $pagelinkedfrom )
</span><span class="cx"> return $this->pingback_error( 0, __( 'A valid URL was not provided.' ) );
</span><span class="cx">
</span><span class="lines">@@ -5404,9 +5797,17 @@
</span><span class="cx"> $linea = wp_remote_retrieve_body( wp_safe_remote_get( $pagelinkedfrom, $http_api_args ) );
</span><span class="cx">
</span><span class="cx"> if ( !$linea )
</span><del>- return $this->pingback_error( 16, __( 'The source URL does not exist.' ) );
</del><ins>+ return $this->pingback_error( 16, __( 'The source URL does not exist.' ) );
</ins><span class="cx">
</span><del>- $linea = apply_filters('pre_remote_source', $linea, $pagelinkedto);
</del><ins>+ /**
+ * Filter the pingback remote source.
+ *
+ * @since 2.5.0
+ *
+ * @param string $linea Response object for the page linked from.
+ * @param string $pagelinkedto URL of the page linked to.
+ */
+ $linea = apply_filters( 'pre_remote_source', $linea, $pagelinkedto );
</ins><span class="cx">
</span><span class="cx"> // Work around bug in strip_tags():
</span><span class="cx"> $linea = str_replace('<!DOC', '<DOC', $linea);
</span><span class="lines">@@ -5471,8 +5872,16 @@
</span><span class="cx"> $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_author_email', 'comment_content', 'comment_type');
</span><span class="cx">
</span><span class="cx"> $comment_ID = wp_new_comment($commentdata);
</span><del>- do_action('pingback_post', $comment_ID);
</del><span class="cx">
</span><ins>+ /**
+ * Fires after a post pingback has been sent.
+ *
+ * @since 0.71
+ *
+ * @param int $comment_ID Comment ID.
+ */
+ do_action( 'pingback_post', $comment_ID );
+
</ins><span class="cx"> return sprintf(__('Pingback from %1$s to %2$s registered. Keep the web talking! :-)'), $pagelinkedfrom, $pagelinkedto);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -5490,7 +5899,8 @@
</span><span class="cx">
</span><span class="cx"> global $wpdb;
</span><span class="cx">
</span><del>- do_action('xmlrpc_call', 'pingback.extensions.getPingbacks');
</del><ins>+ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
+ do_action( 'xmlrpc_call', 'pingback.extensions.getPingbacks' );
</ins><span class="cx">
</span><span class="cx"> $this->escape($args);
</span><span class="cx">
</span><span class="lines">@@ -5524,6 +5934,13 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> protected function pingback_error( $code, $message ) {
</span><ins>+ /**
+ * Filter the XML-RPC pingback error return.
+ *
+ * @since 3.5.1
+ *
+ * @param IXR_Error $error An IXR_Error object containing the error code and message.
+ */
</ins><span class="cx"> return apply_filters( 'xmlrpc_pingback_error', new IXR_Error( $code, $message ) );
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre>
</div>
</div>
</body>
</html>