Changeset 6803 for trunk/wp-includes/post.php
- Timestamp:
- 02/13/2008 06:49:23 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r6777 r6803 697 697 698 698 function sanitize_post($post, $context = 'display') { 699 700 699 if ( 'raw' == $context ) 701 700 return $post; 702 701 703 // TODO: Use array keys instead of hard coded list704 $fields = array('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_content_filtered', 'post_title', 'post_excerpt', 'post_status', 'post_type', 'comment_status', 'ping_status', 'post_password', 'post_name', 'to_ping', 'pinged', 'post_date', 'post_date_gmt', 'post_parent', 'menu_order', 'post_mime_type', 'post_category');705 706 $do_object = false;707 702 if ( is_object($post) ) 708 $do_object = true; 709 710 foreach ( $fields as $field ) { 711 if ( $do_object ) 703 foreach ( array_keys(get_object_vars($post)) as $field ) 712 704 $post->$field = sanitize_post_field($field, $post->$field, $post->ID, $context); 713 else 705 else 706 foreach ( array_keys($post) as $field ) 714 707 $post[$field] = sanitize_post_field($field, $post[$field], $post['ID'], $context); 715 }716 708 717 709 return $post;
Note: See TracChangeset
for help on using the changeset viewer.