Make WordPress Core

Changeset 31552


Ignore:
Timestamp:
02/26/2015 05:17:42 AM (10 years ago)
Author:
wonderboymusic
Message:

Add missing access modifiers to WP_Press_This.

See #31456.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-press-this.php

    r31534 r31552  
    134134            wp_send_json_error( array( 'errorMessage' => __( 'Missing post ID.' ) ) );
    135135        }
    136    
     136
    137137        if ( ! current_user_can( 'edit_post', $post_id ) ) {
    138138            wp_send_json_error( array( 'errorMessage' => __( 'Cheatin’ uh?' ) ) );
    139139        }
    140    
     140
    141141        $post = array(
    142142            'ID'            => $post_id,
     
    149149            'post_category' => ( ! empty( $_POST['post_category'] ) ) ? $_POST['post_category'] : array(),
    150150        );
    151    
     151
    152152        if ( ! empty( $_POST['post_status'] ) && 'publish' === $_POST['post_status'] ) {
    153153            if ( current_user_can( 'publish_posts' ) ) {
     
    165165
    166166        $updated = wp_update_post( $post, true );
    167    
     167
    168168        if ( is_wp_error( $updated ) || intval( $updated ) < 1 ) {
    169169            wp_send_json_error( array( 'errorMessage' => __( 'Error while saving the post. Please try again later.' ) ) );
     
    193193                $redirect = apply_filters( 'press_this_save_redirect', get_edit_post_link( $post_id, 'raw' ), $post_id, $post['post_status'] );
    194194            }
    195    
     195
    196196            wp_send_json_success( array( 'redirect' => $redirect ) );
    197197        }
     
    520520     * @param WP_Post $post Post object.
    521521     */
    522     function post_formats_html( $post ) {
     522    public function post_formats_html( $post ) {
    523523        if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post->post_type, 'post-formats' ) ) {
    524524            $post_formats = get_theme_support( 'post-formats' );
     
    565565     * @param WP_Post $post Post object.
    566566     */
    567     function categories_html( $post ) {
     567    public function categories_html( $post ) {
    568568        $taxonomy = get_taxonomy( 'category' );
    569569
     
    612612     * @param WP_Post $post Post object.
    613613     */
    614     function tags_html( $post ) {
     614    public function tags_html( $post ) {
    615615        $taxonomy              = get_taxonomy( 'post_tag' );
    616616        $user_can_assign_terms = current_user_can( $taxonomy->cap->assign_terms );
Note: See TracChangeset for help on using the changeset viewer.