Changeset 15779
- Timestamp:
- 10/12/2010 07:43:54 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/post.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r15778 r15779 511 511 * 512 512 * @param int|object $post The post for which to assign a format 513 * @param string $format A format to assign. 513 * @param string $format A format to assign. Use an empty string or array to remove all formats from the post. 514 514 * @return mixed WP_Error on error. Array of affected term IDs on success. 515 515 */ … … 520 520 return new WP_Error('invalid_post', __('Invalid post')); 521 521 522 $format = sanitize_key($format); 523 524 return wp_set_post_terms($post->ID, array('post-format-' . $format), 'post_format'); 522 if ( !empty($format) ) 523 $format = 'post-format-' . sanitize_key($format); 524 525 return wp_set_post_terms($post->ID, $format, 'post_format'); 525 526 } 526 527
Note: See TracChangeset
for help on using the changeset viewer.