Changeset 31552
- Timestamp:
- 02/26/2015 05:17:42 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-press-this.php
r31534 r31552 134 134 wp_send_json_error( array( 'errorMessage' => __( 'Missing post ID.' ) ) ); 135 135 } 136 136 137 137 if ( ! current_user_can( 'edit_post', $post_id ) ) { 138 138 wp_send_json_error( array( 'errorMessage' => __( 'Cheatin’ uh?' ) ) ); 139 139 } 140 140 141 141 $post = array( 142 142 'ID' => $post_id, … … 149 149 'post_category' => ( ! empty( $_POST['post_category'] ) ) ? $_POST['post_category'] : array(), 150 150 ); 151 151 152 152 if ( ! empty( $_POST['post_status'] ) && 'publish' === $_POST['post_status'] ) { 153 153 if ( current_user_can( 'publish_posts' ) ) { … … 165 165 166 166 $updated = wp_update_post( $post, true ); 167 167 168 168 if ( is_wp_error( $updated ) || intval( $updated ) < 1 ) { 169 169 wp_send_json_error( array( 'errorMessage' => __( 'Error while saving the post. Please try again later.' ) ) ); … … 193 193 $redirect = apply_filters( 'press_this_save_redirect', get_edit_post_link( $post_id, 'raw' ), $post_id, $post['post_status'] ); 194 194 } 195 195 196 196 wp_send_json_success( array( 'redirect' => $redirect ) ); 197 197 } … … 520 520 * @param WP_Post $post Post object. 521 521 */ 522 function post_formats_html( $post ) {522 public function post_formats_html( $post ) { 523 523 if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post->post_type, 'post-formats' ) ) { 524 524 $post_formats = get_theme_support( 'post-formats' ); … … 565 565 * @param WP_Post $post Post object. 566 566 */ 567 function categories_html( $post ) {567 public function categories_html( $post ) { 568 568 $taxonomy = get_taxonomy( 'category' ); 569 569 … … 612 612 * @param WP_Post $post Post object. 613 613 */ 614 function tags_html( $post ) {614 public function tags_html( $post ) { 615 615 $taxonomy = get_taxonomy( 'post_tag' ); 616 616 $user_can_assign_terms = current_user_can( $taxonomy->cap->assign_terms );
Note: See TracChangeset
for help on using the changeset viewer.