Changeset 55308 for trunk/src/wp-includes/class-wp-xmlrpc-server.php
- Timestamp:
- 02/12/2023 06:06:33 PM (3 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/class-wp-xmlrpc-server.php (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-xmlrpc-server.php
r54877 r55308 3721 3721 $username = $args[1]; 3722 3722 $password = $args[2]; 3723 $comment_ ID= (int) $args[3];3723 $comment_id = (int) $args[3]; 3724 3724 3725 3725 $user = $this->login( $username, $password ); … … 3728 3728 } 3729 3729 3730 if ( ! get_comment( $comment_ ID) ) {3730 if ( ! get_comment( $comment_id ) ) { 3731 3731 return new IXR_Error( 404, __( 'Invalid comment ID.' ) ); 3732 3732 } 3733 3733 3734 if ( ! current_user_can( 'edit_comment', $comment_ ID) ) {3734 if ( ! current_user_can( 'edit_comment', $comment_id ) ) { 3735 3735 return new IXR_Error( 403, __( 'Sorry, you are not allowed to delete this comment.' ) ); 3736 3736 } … … 3739 3739 do_action( 'xmlrpc_call', 'wp.deleteComment', $args, $this ); 3740 3740 3741 $status = wp_delete_comment( $comment_ ID);3741 $status = wp_delete_comment( $comment_id ); 3742 3742 3743 3743 if ( $status ) { … … 3747 3747 * @since 3.4.0 3748 3748 * 3749 * @param int $comment_ IDID of the deleted comment.3749 * @param int $comment_id ID of the deleted comment. 3750 3750 * @param array $args An array of arguments to delete the comment. 3751 3751 */ 3752 do_action( 'xmlrpc_call_success_wp_deleteComment', $comment_ ID, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase3752 do_action( 'xmlrpc_call_success_wp_deleteComment', $comment_id, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase 3753 3753 } 3754 3754 … … 3788 3788 $username = $args[1]; 3789 3789 $password = $args[2]; 3790 $comment_ ID= (int) $args[3];3790 $comment_id = (int) $args[3]; 3791 3791 $content_struct = $args[4]; 3792 3792 … … 3796 3796 } 3797 3797 3798 if ( ! get_comment( $comment_ ID) ) {3798 if ( ! get_comment( $comment_id ) ) { 3799 3799 return new IXR_Error( 404, __( 'Invalid comment ID.' ) ); 3800 3800 } 3801 3801 3802 if ( ! current_user_can( 'edit_comment', $comment_ ID) ) {3802 if ( ! current_user_can( 'edit_comment', $comment_id ) ) { 3803 3803 return new IXR_Error( 403, __( 'Sorry, you are not allowed to moderate or edit this comment.' ) ); 3804 3804 } … … 3807 3807 do_action( 'xmlrpc_call', 'wp.editComment', $args, $this ); 3808 3808 $comment = array( 3809 'comment_ID' => $comment_ ID,3809 'comment_ID' => $comment_id, 3810 3810 ); 3811 3811 … … 3859 3859 * @since 3.4.0 3860 3860 * 3861 * @param int $comment_ IDID of the updated comment.3861 * @param int $comment_id ID of the updated comment. 3862 3862 * @param array $args An array of arguments to update the comment. 3863 3863 */ 3864 do_action( 'xmlrpc_call_success_wp_editComment', $comment_ ID, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase3864 do_action( 'xmlrpc_call_success_wp_editComment', $comment_id, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase 3865 3865 3866 3866 return true; … … 4000 4000 do_action( 'xmlrpc_call', 'wp.newComment', $args, $this ); 4001 4001 4002 $comment_ ID= wp_new_comment( $comment, true );4003 if ( is_wp_error( $comment_ ID) ) {4004 return new IXR_Error( 403, $comment_ ID->get_error_message() );4005 } 4006 4007 if ( ! $comment_ ID) {4002 $comment_id = wp_new_comment( $comment, true ); 4003 if ( is_wp_error( $comment_id ) ) { 4004 return new IXR_Error( 403, $comment_id->get_error_message() ); 4005 } 4006 4007 if ( ! $comment_id ) { 4008 4008 return new IXR_Error( 403, __( 'Something went wrong.' ) ); 4009 4009 } … … 4014 4014 * @since 3.4.0 4015 4015 * 4016 * @param int $comment_ IDID of the new comment.4016 * @param int $comment_id ID of the new comment. 4017 4017 * @param array $args An array of new comment arguments. 4018 4018 */ 4019 do_action( 'xmlrpc_call_success_wp_newComment', $comment_ ID, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase4020 4021 return $comment_ ID;4019 do_action( 'xmlrpc_call_success_wp_newComment', $comment_id, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase 4020 4021 return $comment_id; 4022 4022 } 4023 4023 … … 7041 7041 ); 7042 7042 7043 $comment_ ID= wp_new_comment( $commentdata );7044 7045 if ( is_wp_error( $comment_ ID) ) {7046 return $this->pingback_error( 0, $comment_ ID->get_error_message() );7043 $comment_id = wp_new_comment( $commentdata ); 7044 7045 if ( is_wp_error( $comment_id ) ) { 7046 return $this->pingback_error( 0, $comment_id->get_error_message() ); 7047 7047 } 7048 7048 … … 7052 7052 * @since 0.71 7053 7053 * 7054 * @param int $comment_ IDComment ID.7054 * @param int $comment_id Comment ID. 7055 7055 */ 7056 do_action( 'pingback_post', $comment_ ID);7056 do_action( 'pingback_post', $comment_id ); 7057 7057 7058 7058 /* translators: 1: URL of the page linked from, 2: URL of the page linked to. */
Note: See TracChangeset
for help on using the changeset viewer.