Make WordPress Core

Changeset 19864


Ignore:
Timestamp:
02/08/2012 02:54:15 PM (13 years ago)
Author:
ryan
Message:

Space between if and open paren

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class-wp-xmlrpc-server.php

    r19848 r19864  
    619619
    620620        $post_type = get_post_type_object( $post_data['post_type'] );
    621         if( ! ( (bool) $post_type ) )
     621        if ( ! ( (bool) $post_type ) )
    622622            return new IXR_Error( 403, __( 'Invalid post type' ) );
    623623
    624         if( ! current_user_can( $post_type->cap->edit_posts ) )
     624        if ( ! current_user_can( $post_type->cap->edit_posts ) )
    625625            return new IXR_Error( 401, __( 'Sorry, you are not allowed to post on this site.' ) );
    626626
     
    630630                break;
    631631            case 'private':
    632                 if( ! current_user_can( $post_type->cap->publish_posts ) )
     632                if ( ! current_user_can( $post_type->cap->publish_posts ) )
    633633                    return new IXR_Error( 401, __( 'Sorry, you are not allowed to create private posts in this post type' ));
    634634                break;
    635635            case 'publish':
    636636            case 'future':
    637                 if( ! current_user_can( $post_type->cap->publish_posts ) )
     637                if ( ! current_user_can( $post_type->cap->publish_posts ) )
    638638                    return new IXR_Error( 401, __( 'Sorry, you are not allowed to publish posts in this post type' ));
    639639                break;
     
    648648
    649649        $post_data['post_author'] = absint( $post_data['post_author'] );
    650         if( ! empty( $post_data['post_author'] ) && $post_data['post_author'] != $user->ID ) {
    651             if( ! current_user_can( $post_type->cap->edit_others_posts ) )
     650        if ( ! empty( $post_data['post_author'] ) && $post_data['post_author'] != $user->ID ) {
     651            if ( ! current_user_can( $post_type->cap->edit_others_posts ) )
    652652                return new IXR_Error( 401, __( 'You are not allowed to create posts as this user.' ) );
    653653
    654654            $author = get_userdata( $post_data['post_author'] );
    655655
    656             if( ! $author )
     656            if ( ! $author )
    657657                return new IXR_Error( 404, __( 'Invalid author ID.' ) );
    658658        }
     
    661661        }
    662662
    663         if( isset( $post_data['comment_status'] ) ) {
    664             if( ! post_type_supports( $post_data['post_type'], 'comments' ) || ( $post_data['comment_status'] != 'open' && $post_data['comment_status'] != 'closed' ) ) {
     663        if ( isset( $post_data['comment_status'] ) ) {
     664            if ( ! post_type_supports( $post_data['post_type'], 'comments' ) || ( $post_data['comment_status'] != 'open' && $post_data['comment_status'] != 'closed' ) ) {
    665665                unset( $post_data['comment_status'] );
    666666            }
    667667        }
    668668
    669         if( isset( $post_data['ping_status'] ) ) {
    670             if( ! post_type_supports( $post_data['post_type'], 'trackbacks' ) || ( $post_data['ping_status'] != 'open' && $post_data['ping_status'] != 'closed' ) ) {
     669        if ( isset( $post_data['ping_status'] ) ) {
     670            if ( ! post_type_supports( $post_data['post_type'], 'trackbacks' ) || ( $post_data['ping_status'] != 'open' && $post_data['ping_status'] != 'closed' ) ) {
    671671                unset( $post_data['ping_status'] );
    672672            }
     
    693693        $sticky = $post_data['sticky'] ? true : false;
    694694
    695         if( $post_data['post_type'] == 'post' && $sticky == true ) {
    696             if( ! current_user_can( $post_type->cap->edit_others_posts ) )
     695        if ( $post_data['post_type'] == 'post' && $sticky == true ) {
     696            if ( ! current_user_can( $post_type->cap->edit_others_posts ) )
    697697                return new IXR_Error( 401, __( 'Sorry, you are not allowed to stick this post.' ) );
    698698
    699             if( $post_data['post_status'] != 'publish' )
     699            if ( $post_data['post_status'] != 'publish' )
    700700                return new IXR_Error( 401, __( 'Only published posts can be made sticky.' ) );
    701701
     
    703703        }
    704704
    705         if( isset ( $post_data['custom_fields'] ) && post_type_supports( $post_data['post_type'], 'custom-fields' ) ) {
     705        if ( isset ( $post_data['custom_fields'] ) && post_type_supports( $post_data['post_type'], 'custom-fields' ) ) {
    706706            $this->set_custom_fields( $post_ID, $post_data['custom_fields'] );
    707707        }
    708708
    709         if( isset( $post_data['terms'] ) || isset( $post_data['terms_names'] ) ) {
     709        if ( isset( $post_data['terms'] ) || isset( $post_data['terms_names'] ) ) {
    710710            $post_type_taxonomies = get_object_taxonomies( $post_data['post_type'], 'objects' );
    711711
     
    714714
    715715            // first validate the terms specified by ID
    716             if( isset( $post_data['terms'] ) && is_array( $post_data['terms'] ) ) {
     716            if ( isset( $post_data['terms'] ) && is_array( $post_data['terms'] ) ) {
    717717                $taxonomies = array_keys( $post_data['terms'] );
    718718
     
    722722                        return new IXR_Error( 401, __( 'Sorry, one of the given taxonomies is not supported by the post type.' ) );
    723723
    724                     if( ! current_user_can( $post_type_taxonomies[$taxonomy]->cap->assign_terms ) )
     724                    if ( ! current_user_can( $post_type_taxonomies[$taxonomy]->cap->assign_terms ) )
    725725                        return new IXR_Error( 401, __( 'Sorry, you are not allowed to assign a term to one of the given taxonomies' ) );
    726726
     
    745745                        return new IXR_Error( 401, __( 'Sorry, one of the given taxonomies is not supported by the post type.' ) );
    746746
    747                     if( ! current_user_can( $post_type_taxonomies[$taxonomy]->cap->assign_terms ) )
     747                    if ( ! current_user_can( $post_type_taxonomies[$taxonomy]->cap->assign_terms ) )
    748748                        return new IXR_Error( 401, __( 'Sorry, you are not allowed to assign a term to one of the given taxonomies.' ) );
    749749
    750750                    // for hierarchical taxonomies, we can't assign a term when multiple terms in the hierarchy share the same name
    751751                    $ambiguous_terms = array();
    752                     if( is_taxonomy_hierarchical( $taxonomy ) ) {
     752                    if ( is_taxonomy_hierarchical( $taxonomy ) ) {
    753753                        $tax_term_names = get_terms( $taxonomy, array( 'fields' => 'names', 'hide_empty' => false ) );
    754754
     
    771771                        if ( ! $term ) {
    772772                            // term doesn't exist, so check that the user is allowed to create new terms
    773                             if( ! current_user_can( $post_type_taxonomies[$taxonomy]->cap->edit_terms ) )
     773                            if ( ! current_user_can( $post_type_taxonomies[$taxonomy]->cap->edit_terms ) )
    774774                                return new IXR_Error( 401, __( 'Sorry, you are not allowed to add a term to one of the given taxonomies.' ) );
    775775
     
    797797        }
    798798
    799         if( isset( $post_data['post_format'] ) ) {
     799        if ( isset( $post_data['post_format'] ) ) {
    800800            $format = set_post_format( $post_ID, $post_data['post_format'] );
    801801
     
    909909
    910910        $post_type = get_post_type_object( $post['post_type'] );
    911         if( ! current_user_can( $post_type->cap->delete_post, $post_id ) )
     911        if ( ! current_user_can( $post_type->cap->delete_post, $post_id ) )
    912912            return new IXR_Error( 401, __( 'Sorry, you are not allowed to delete this post.' ) );
    913913
Note: See TracChangeset for help on using the changeset viewer.