wp/wp-admin/post.php
changeset 18 be944660c56a
parent 16 a86126ab1dd4
child 19 3d72ae0968f4
equal deleted inserted replaced
17:34716fd837a4 18:be944660c56a
   289 
   289 
   290 		if ( ! wp_untrash_post( $post_id ) ) {
   290 		if ( ! wp_untrash_post( $post_id ) ) {
   291 			wp_die( __( 'Error in restoring the item from Trash.' ) );
   291 			wp_die( __( 'Error in restoring the item from Trash.' ) );
   292 		}
   292 		}
   293 
   293 
   294 		wp_redirect( add_query_arg( 'untrashed', 1, $sendback ) );
   294 		$sendback = add_query_arg(
       
   295 			array(
       
   296 				'untrashed' => 1,
       
   297 				'ids'       => $post_id,
       
   298 			),
       
   299 			$sendback
       
   300 		);
       
   301 		wp_redirect( $sendback );
   295 		exit;
   302 		exit;
   296 
   303 
   297 	case 'delete':
   304 	case 'delete':
   298 		check_admin_referer( 'delete-post_' . $post_id );
   305 		check_admin_referer( 'delete-post_' . $post_id );
   299 
   306 
   330 
   337 
   331 		wp_redirect( $url );
   338 		wp_redirect( $url );
   332 		exit;
   339 		exit;
   333 
   340 
   334 	case 'toggle-custom-fields':
   341 	case 'toggle-custom-fields':
   335 		check_admin_referer( 'toggle-custom-fields' );
   342 		check_admin_referer( 'toggle-custom-fields', 'toggle-custom-fields-nonce' );
   336 
   343 
   337 		$current_user_id = get_current_user_id();
   344 		$current_user_id = get_current_user_id();
   338 		if ( $current_user_id ) {
   345 		if ( $current_user_id ) {
   339 			$enable_custom_fields = (bool) get_user_meta( $current_user_id, 'enable_custom_fields', true );
   346 			$enable_custom_fields = (bool) get_user_meta( $current_user_id, 'enable_custom_fields', true );
   340 			update_user_meta( $current_user_id, 'enable_custom_fields', ! $enable_custom_fields );
   347 			update_user_meta( $current_user_id, 'enable_custom_fields', ! $enable_custom_fields );