Ticket #21767: 21767.18.diff
File 21767.18.diff, 6.4 KB (added by , 11 years ago) |
---|
-
wp-includes/post.php
2397 2397 wp_add_post_meta($post_id,'_wp_trash_meta_time', time()); 2398 2398 2399 2399 $post['post_status'] = 'trash'; 2400 $post['slashed'] = false; 2401 2400 2402 wp_insert_post($post); 2401 2403 2402 2404 wp_trash_post_comments($post_id); … … 2432 2434 delete_post_meta($post_id, '_wp_trash_meta_status'); 2433 2435 delete_post_meta($post_id, '_wp_trash_meta_time'); 2434 2436 2437 $post['slashed'] = false; 2438 2435 2439 wp_insert_post($post); 2436 2440 2437 2441 wp_untrash_post_comments($post_id); … … 2670 2674 * 'guid' - Global Unique ID for referencing the attachment. 2671 2675 * 'post_content_filtered' - Post content filtered. 2672 2676 * 'post_excerpt' - Post excerpt. 2677 * 'slashed' - Whether the passed data is slashed or not. The default is true. 2673 2678 * 2674 2679 * @since 1.0.0 2675 2680 * @uses $wpdb … … 2691 2696 'ping_status' => get_option('default_ping_status'), 'post_parent' => 0, 2692 2697 'menu_order' => 0, 'to_ping' => '', 'pinged' => '', 'post_password' => '', 2693 2698 'guid' => '', 'post_content_filtered' => '', 'post_excerpt' => '', 'import_id' => 0, 2694 'post_content' => '', 'post_title' => '' );2699 'post_content' => '', 'post_title' => '', 'slashed' => true ); 2695 2700 2696 2701 $postarr = wp_parse_args($postarr, $defaults); 2697 2702 2698 2703 unset( $postarr[ 'filter' ] ); 2699 2704 2705 if ( $postarr['slashed'] ) 2706 wp_unslash( $postarr ); 2707 2700 2708 $postarr = sanitize_post($postarr, 'db'); 2701 2709 2702 2710 // export array as variables … … 2981 2989 $postarr['post_date_gmt'] = ''; 2982 2990 } 2983 2991 2992 $postarr['slashed'] = false; 2993 2984 2994 if ($postarr['post_type'] == 'attachment') 2985 2995 return wp_insert_attachment($postarr); 2986 2996 … … 3901 3911 * 'guid' - Global Unique ID for referencing the attachment. 3902 3912 * 'post_content_filtered' - Attachment post content filtered. 3903 3913 * 'post_excerpt' - Attachment excerpt. 3914 * 'slashed' - Whether the passed data is slashed or not. The default is true. 3904 3915 * 3905 3916 * @since 2.0.0 3906 3917 * @uses $wpdb … … 3919 3930 $defaults = array('post_status' => 'inherit', 'post_type' => 'post', 'post_author' => $user_ID, 3920 3931 'ping_status' => get_option('default_ping_status'), 'post_parent' => 0, 3921 3932 'menu_order' => 0, 'to_ping' => '', 'pinged' => '', 'post_password' => '', 3922 'guid' => '', 'post_content_filtered' => '', 'post_excerpt' => '', 'import_id' => 0, 'context' => ''); 3933 'guid' => '', 'post_content_filtered' => '', 'post_excerpt' => '', 'import_id' => 0, 'context' => '', 3934 'slashed' => true ); 3923 3935 3924 3936 $object = wp_parse_args($object, $defaults); 3937 3938 if ( $postarr['slashed'] ) 3939 wp_unslash( $postarr ); 3940 3925 3941 if ( !empty($parent) ) 3926 3942 $object['post_parent'] = $parent; 3927 3943 -
wp-includes/revision.php
241 241 return new WP_Error( 'post_type', __( 'Cannot create a revision of a revision' ) ); 242 242 243 243 $post = _wp_post_revision_fields( $post, $autosave ); 244 $post['slashed'] = false; 244 245 245 246 $revision_id = wp_insert_post( $post ); 246 247 if ( is_wp_error($revision_id) ) -
wp-includes/class-wp-xmlrpc-server.php
1202 1202 $this->attach_uploads( $post_ID, $post_data['post_content'] ); 1203 1203 1204 1204 $post_data = apply_filters( 'xmlrpc_wp_insert_post_data', $post_data, $content_struct ); 1205 $post_data['slashed'] = false; 1205 1206 1206 1207 $post_ID = $update ? wp_update_post( $post_data, true ) : wp_insert_post( $post_data, true ); 1207 1208 if ( is_wp_error( $post_ID ) ) … … 3770 3771 $post_date_gmt = current_time('mysql', 1); 3771 3772 3772 3773 $post_data = compact('blog_ID', 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status'); 3774 $post_data['slashed'] = false; 3773 3775 3774 3776 $post_ID = wp_insert_post($post_data); 3775 3777 if ( is_wp_error( $post_ID ) ) … … 4169 4171 if ( isset( $content_struct['wp_post_format'] ) ) 4170 4172 set_post_format( $post_ID, $content_struct['wp_post_format'] ); 4171 4173 4174 $postdata['slashed'] = false; 4175 4172 4176 $post_ID = wp_insert_post( $postdata, true ); 4173 4177 if ( is_wp_error( $post_ID ) ) 4174 4178 return new IXR_Error(500, $post_ID->get_error_message()); -
wp-includes/nav-menu.php
357 357 if ( ! $update ) { 358 358 $post['ID'] = 0; 359 359 $post['post_status'] = 'publish' == $args['menu-item-status'] ? 'publish' : 'draft'; 360 $post_data['slashed'] = false; 360 361 $menu_item_db_id = wp_insert_post( $post ); 361 362 if ( ! $menu_item_db_id || is_wp_error( $menu_item_db_id ) ) 362 363 return $menu_item_db_id; -
wp-mail.php
202 202 $post_category = array(get_option('default_email_category')); 203 203 204 204 $post_data = compact('post_content','post_title','post_date','post_date_gmt','post_author','post_category', 'post_status'); 205 $post_data['slashed'] = false; 205 206 206 207 $post_ID = wp_insert_post($post_data); 207 208 if ( is_wp_error( $post_ID ) ) -
wp-admin/includes/post.php
440 440 $post_excerpt = esc_html( wp_unslash( $_REQUEST['excerpt'] )); 441 441 442 442 if ( $create_in_db ) { 443 $post_id = wp_insert_post( array( 'post_title' => __( 'Auto Draft' ), 'post_type' => $post_type, 'post_status' => 'auto-draft' ) );443 $post_id = wp_insert_post( array( 'post_title' => __( 'Auto Draft' ), 'post_type' => $post_type, 'post_status' => 'auto-draft', 'slashed' => false ) ); 444 444 $post = get_post( $post_id ); 445 445 if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post->post_type, 'post-formats' ) && get_option( 'default_post_format' ) ) 446 446 set_post_format( $post, get_option( 'default_post_format' ) ); … … 566 566 } 567 567 568 568 // Create the post. 569 $post_ID = wp_insert_post( wp_unslash( $_POST ) ); 569 $post = wp_unslash( $_POST ); 570 $post['slashed'] = false; 571 $post_ID = wp_insert_post( $post ); 570 572 if ( is_wp_error( $post_ID ) ) 571 573 return $post_ID; 572 574