Skip to content

Commit 56d7d59

Browse files
Docs: Improve grammar in some DocBlocks for more clarity and consistency.
Follow-up to [8215], [8598]. Props prab18hat, dhruvang21, swissspidy, SergeyBiryukov. Fixes #63892. git-svn-id: https://develop.svn.wordpress.org/trunk@60687 602fd350-edb4-49c9-b593-d223f7449a82
1 parent b41e32e commit 56d7d59

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

src/wp-includes/functions.php

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -760,17 +760,17 @@ function is_serialized_string( $data ) {
760760
}
761761

762762
/**
763-
* Retrieves post title from XMLRPC XML.
763+
* Retrieves post title from XML-RPC XML.
764764
*
765-
* If the title element is not part of the XML, then the default post title from
766-
* the $post_default_title will be used instead.
765+
* If the `title` element is not found in the XML, the default post title
766+
* from the `$post_default_title` global will be used instead.
767767
*
768768
* @since 0.71
769769
*
770770
* @global string $post_default_title Default XML-RPC post title.
771771
*
772-
* @param string $content XMLRPC XML Request content
773-
* @return string Post title
772+
* @param string $content XML-RPC XML Request content.
773+
* @return string Post title.
774774
*/
775775
function xmlrpc_getposttitle( $content ) {
776776
global $post_default_title;
@@ -783,18 +783,20 @@ function xmlrpc_getposttitle( $content ) {
783783
}
784784

785785
/**
786-
* Retrieves the post category or categories from XMLRPC XML.
786+
* Retrieves the post category or categories from XML-RPC XML.
787+
*
788+
* If the `category` element is not found in the XML, the default post category
789+
* from the `$post_default_category` global will be used instead.
790+
* The return type will then be a string.
787791
*
788-
* If the category element is not found, then the default post category will be
789-
* used. The return type then would be what $post_default_category. If the
790-
* category is found, then it will always be an array.
792+
* If the `category` element is found, the return type will be an array.
791793
*
792794
* @since 0.71
793795
*
794796
* @global string $post_default_category Default XML-RPC post category.
795797
*
796-
* @param string $content XMLRPC XML Request content
797-
* @return string|array List of categories or category name.
798+
* @param string $content XML-RPC XML Request content.
799+
* @return string[]|string An array of category names or default category name.
798800
*/
799801
function xmlrpc_getpostcategory( $content ) {
800802
global $post_default_category;
@@ -808,12 +810,12 @@ function xmlrpc_getpostcategory( $content ) {
808810
}
809811

810812
/**
811-
* XMLRPC XML content without title and category elements.
813+
* XML-RPC XML content without title and category elements.
812814
*
813815
* @since 0.71
814816
*
815817
* @param string $content XML-RPC XML Request content.
816-
* @return string XMLRPC XML Request content without title and category elements.
818+
* @return string XML-RPC XML Request content without title and category elements.
817819
*/
818820
function xmlrpc_removepostdata( $content ) {
819821
$content = preg_replace( '/<title>(.+?)<\/title>/si', '', $content );
@@ -1024,10 +1026,10 @@ function is_new_day() {
10241026
}
10251027

10261028
/**
1027-
* Builds URL query based on an associative and, or indexed array.
1029+
* Builds a URL query based on an associative or indexed array.
10281030
*
1029-
* This is a convenient function for easily building url queries. It sets the
1030-
* separator to '&' and uses _http_build_query() function.
1031+
* This is a convenient function for easily building URL queries.
1032+
* It sets the separator to '&' and uses the _http_build_query() function.
10311033
*
10321034
* @since 2.3.0
10331035
*
@@ -4166,7 +4168,7 @@ function _jsonp_wp_die_handler( $message, $title = '', $args = array() ) {
41664168
/**
41674169
* Kills WordPress execution and displays XML response with an error message.
41684170
*
4169-
* This is the handler for wp_die() when processing XMLRPC requests.
4171+
* This is the handler for wp_die() when processing XML-RPC requests.
41704172
*
41714173
* @since 3.2.0
41724174
* @access private

0 commit comments

Comments
 (0)