Changeset 39506 for trunk/src/wp-includes/class-wp-customize-nav-menus.php
- Timestamp:
- 12/05/2016 07:32:09 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-customize-nav-menus.php
r39346 r39506 804 804 $postarr['post_name'] = sanitize_title( $postarr['post_title'] ); 805 805 } 806 if ( ! isset( $postarr['meta_input'] ) ) { 807 $postarr['meta_input'] = array(); 808 } 809 $postarr['meta_input']['_customize_draft_post_name'] = $postarr['post_name']; 810 unset( $postarr['post_name'] ); 806 811 807 812 add_filter( 'wp_insert_post_empty_content', '__return_false', 1000 ); … … 1193 1198 foreach ( $post_ids as $post_id ) { 1194 1199 $target_status = 'attachment' === get_post_type( $post_id ) ? 'inherit' : 'publish'; 1200 $args = array( 1201 'ID' => $post_id, 1202 'post_status' => $target_status, 1203 ); 1204 $post_name = get_post_meta( $post_id, '_customize_draft_post_name', true ); 1205 if ( $post_name ) { 1206 $args['post_name'] = $post_name; 1207 } 1195 1208 1196 1209 // Note that wp_publish_post() cannot be used because unique slugs need to be assigned. 1197 wp_update_post( array( 'ID' => $post_id, 'post_status' => $target_status ) ); 1210 wp_update_post( wp_slash( $args ) ); 1211 1212 delete_post_meta( $post_id, '_customize_draft_post_name' ); 1198 1213 } 1199 1214 }
Note: See TracChangeset
for help on using the changeset viewer.