From 4310147e544009663a3a6befacdbca189036706c Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 26 Feb 2015 05:18:25 +0000 Subject: [PATCH] Add missing access modifiers to `WP_Press_This`. See #31456. Built from https://develop.svn.wordpress.org/trunk@31552 git-svn-id: http://core.svn.wordpress.org/trunk@31533 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-press-this.php | 16 ++++++++-------- wp-includes/version.php | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/wp-admin/includes/class-wp-press-this.php b/wp-admin/includes/class-wp-press-this.php index 4d7e2b2fe9..37dfb4e709 100644 --- a/wp-admin/includes/class-wp-press-this.php +++ b/wp-admin/includes/class-wp-press-this.php @@ -133,11 +133,11 @@ class WP_Press_This { if ( empty( $_POST['post_ID'] ) || ! $post_id = (int) $_POST['post_ID'] ) { wp_send_json_error( array( 'errorMessage' => __( 'Missing post ID.' ) ) ); } - + if ( ! current_user_can( 'edit_post', $post_id ) ) { wp_send_json_error( array( 'errorMessage' => __( 'Cheatin’ uh?' ) ) ); } - + $post = array( 'ID' => $post_id, 'post_title' => ( ! empty( $_POST['title'] ) ) ? sanitize_text_field( trim( $_POST['title'] ) ) : '', @@ -148,7 +148,7 @@ class WP_Press_This { 'tax_input' => ( ! empty( $_POST['tax_input'] ) ) ? $_POST['tax_input'] : array(), 'post_category' => ( ! empty( $_POST['post_category'] ) ) ? $_POST['post_category'] : array(), ); - + if ( ! empty( $_POST['post_status'] ) && 'publish' === $_POST['post_status'] ) { if ( current_user_can( 'publish_posts' ) ) { $post['post_status'] = 'publish'; @@ -164,7 +164,7 @@ class WP_Press_This { } $updated = wp_update_post( $post, true ); - + if ( is_wp_error( $updated ) || intval( $updated ) < 1 ) { wp_send_json_error( array( 'errorMessage' => __( 'Error while saving the post. Please try again later.' ) ) ); } else { @@ -192,7 +192,7 @@ class WP_Press_This { /** This filter is documented in wp-admin/includes/class-wp-press-this.php */ $redirect = apply_filters( 'press_this_save_redirect', get_edit_post_link( $post_id, 'raw' ), $post_id, $post['post_status'] ); } - + wp_send_json_success( array( 'redirect' => $redirect ) ); } } @@ -519,7 +519,7 @@ class WP_Press_This { * * @param WP_Post $post Post object. */ - function post_formats_html( $post ) { + public function post_formats_html( $post ) { if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post->post_type, 'post-formats' ) ) { $post_formats = get_theme_support( 'post-formats' ); @@ -564,7 +564,7 @@ class WP_Press_This { * * @param WP_Post $post Post object. */ - function categories_html( $post ) { + public function categories_html( $post ) { $taxonomy = get_taxonomy( 'category' ); if ( current_user_can( $taxonomy->cap->edit_terms ) ) { @@ -611,7 +611,7 @@ class WP_Press_This { * * @param WP_Post $post Post object. */ - function tags_html( $post ) { + public function tags_html( $post ) { $taxonomy = get_taxonomy( 'post_tag' ); $user_can_assign_terms = current_user_can( $taxonomy->cap->assign_terms ); $esc_tags = get_terms_to_edit( $post->ID, 'post_tag' ); diff --git a/wp-includes/version.php b/wp-includes/version.php index c807c5a4f7..0152c6fcaa 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.2-alpha-31551'; +$wp_version = '4.2-alpha-31552'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.