equal
deleted
inserted
replaced
39 /** |
39 /** |
40 * Check if a post has any of the given formats, or any format. |
40 * Check if a post has any of the given formats, or any format. |
41 * |
41 * |
42 * @since 3.1.0 |
42 * @since 3.1.0 |
43 * |
43 * |
44 * @param string|string[] $format Optional. The format or formats to check. |
44 * @param string|string[] $format Optional. The format or formats to check. Default empty array. |
45 * @param WP_Post|int|null $post Optional. The post to check. Defaults to the current post in the loop. |
45 * @param WP_Post|int|null $post Optional. The post to check. Defaults to the current post in the loop. |
46 * @return bool True if the post has any of the given formats (or any format, if no format specified), |
46 * @return bool True if the post has any of the given formats (or any format, if no format specified), |
47 * false otherwise. |
47 * false otherwise. |
48 */ |
48 */ |
49 function has_post_format( $format = array(), $post = null ) { |
49 function has_post_format( $format = array(), $post = null ) { |
61 /** |
61 /** |
62 * Assign a format to a post |
62 * Assign a format to a post |
63 * |
63 * |
64 * @since 3.1.0 |
64 * @since 3.1.0 |
65 * |
65 * |
66 * @param int|object $post The post for which to assign a format. |
66 * @param int|WP_Post $post The post for which to assign a format. |
67 * @param string $format A format to assign. Use an empty string or array to remove all formats from the post. |
67 * @param string $format A format to assign. Use an empty string or array to remove all formats from the post. |
68 * @return array|WP_Error|false Array of affected term IDs on success. WP_Error on error. |
68 * @return array|WP_Error|false Array of affected term IDs on success. WP_Error on error. |
69 */ |
69 */ |
70 function set_post_format( $post, $format ) { |
70 function set_post_format( $post, $format ) { |
71 $post = get_post( $post ); |
71 $post = get_post( $post ); |
72 |
72 |