Skip to content

Commit

Permalink
Coding Standards: Use strict comparison in `wp_xmlrpc_server::_insert…
Browse files Browse the repository at this point in the history
…_post()`.

Follow-up to [19848].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

git-svn-id: https://develop.svn.wordpress.org/trunk@59707 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Jan 25, 2025
1 parent 08a292b commit fe241a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wp-includes/class-wp-xmlrpc-server.php
Original file line number Diff line number Diff line change
Expand Up @@ -1488,7 +1488,7 @@ protected function _insert_post( $user, $content_struct ) {
}

$post_data['post_author'] = absint( $post_data['post_author'] );
if ( ! empty( $post_data['post_author'] ) && $post_data['post_author'] != $user->ID ) {
if ( ! empty( $post_data['post_author'] ) && $post_data['post_author'] !== $user->ID ) {
if ( ! current_user_can( $post_type->cap->edit_others_posts ) ) {
return new IXR_Error( 401, __( 'Sorry, you are not allowed to create posts as this user.' ) );
}
Expand Down

0 comments on commit fe241a9

Please sign in to comment.