Make WordPress Core

Ticket #27471: 27471.diff

File 27471.diff, 538 bytes (added by jesin, 11 years ago)

Stop commenting via XML-RPC if comments are closed

  • wp-includes/class-wp-xmlrpc-server.php

     
    29802980                if ( ! get_post($post_id) )
    29812981                        return new IXR_Error( 404, __( 'Invalid post ID.' ) );
    29822982
     2983                if ( ! comments_open( $post_id ) )
     2984                        return new IXR_Error( 403, __( 'Sorry, comments are closed for this item.' ) );
     2985
    29832986                $comment['comment_post_ID'] = $post_id;
    29842987
    29852988                if ( $logged_in ) {