Changeset 49108 for trunk/src/wp-includes/class-wp-xmlrpc-server.php
- Timestamp:
- 10/08/2020 09:13:57 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-xmlrpc-server.php
r49098 r49108 799 799 800 800 // For integers which may be larger than XML-RPC supports ensure we return strings. 801 $_term['term_id'] = strval( $_term['term_id'] );802 $_term['term_group'] = strval( $_term['term_group'] );803 $_term['term_taxonomy_id'] = strval( $_term['term_taxonomy_id'] );804 $_term['parent'] = strval( $_term['parent'] );801 $_term['term_id'] = (string) $_term['term_id']; 802 $_term['term_group'] = (string) $_term['term_group']; 803 $_term['term_taxonomy_id'] = (string) $_term['term_taxonomy_id']; 804 $_term['parent'] = (string) $_term['parent']; 805 805 806 806 // Count we are happy to return as an integer because people really shouldn't use terms that much. 807 $_term['count'] = intval( $_term['count'] );807 $_term['count'] = (int) $_term['count']; 808 808 809 809 // Get term meta. … … 857 857 protected function _prepare_post( $post, $fields ) { 858 858 // Holds the data for this post. built up based on $fields. 859 $_post = array( 'post_id' => strval( $post['ID'] ));859 $_post = array( 'post_id' => (string) $post['ID'] ); 860 860 861 861 // Prepare common post fields. … … 873 873 'post_excerpt' => $post['post_excerpt'], 874 874 'post_content' => $post['post_content'], 875 'post_parent' => strval( $post['post_parent'] ),875 'post_parent' => (string) $post['post_parent'], 876 876 'post_mime_type' => $post['post_mime_type'], 877 877 'link' => get_permalink( $post['ID'] ), 878 878 'guid' => $post['guid'], 879 'menu_order' => intval( $post['menu_order'] ),879 'menu_order' => (int) $post['menu_order'], 880 880 'comment_status' => $post['comment_status'], 881 881 'ping_status' => $post['ping_status'], … … 1010 1010 protected function _prepare_media_item( $media_item, $thumbnail_size = 'thumbnail' ) { 1011 1011 $_media_item = array( 1012 'attachment_id' => strval( $media_item->ID ),1012 'attachment_id' => (string) $media_item->ID, 1013 1013 'date_created_gmt' => $this->_convert_date_gmt( $media_item->post_date_gmt, $media_item->post_date ), 1014 1014 'parent' => $media_item->post_parent, … … 1175 1175 */ 1176 1176 protected function _prepare_user( $user, $fields ) { 1177 $_user = array( 'user_id' => strval( $user->ID ));1177 $_user = array( 'user_id' => (string) $user->ID ); 1178 1178 1179 1179 $user_fields = array( … … 1648 1648 } 1649 1649 1650 return strval( $post_ID );1650 return (string) $post_ID; 1651 1651 } 1652 1652 … … 2095 2095 } 2096 2096 2097 return strval( $term['term_id'] );2097 return (string) $term['term_id']; 2098 2098 } 2099 2099 … … 5567 5567 do_action( 'xmlrpc_call_success_mw_newPost', $post_ID, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase 5568 5568 5569 return strval( $post_ID );5569 return (string) $post_ID; 5570 5570 } 5571 5571 … … 6556 6556 6557 6557 $categories = array(); 6558 $catids = wp_get_post_categories( intval( $post_ID ));6558 $catids = wp_get_post_categories( (int) $post_ID ); 6559 6559 // First listed category will be the primary category. 6560 6560 $isPrimary = true; … … 6813 6813 } elseif ( isset( $urltest['fragment'] ) ) { 6814 6814 // An #anchor is there, it's either... 6815 if ( intval( $urltest['fragment'] )) {6815 if ( (int) $urltest['fragment'] ) { 6816 6816 // ...an integer #XXXX (simplest case), 6817 6817 $post_ID = (int) $urltest['fragment'];
Note: See TracChangeset
for help on using the changeset viewer.