set_post_format [ WordPress Function ]
set_post_format ( $post, $format )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Benzer Fonksiyonlar: get_post_format, has_post_format, get_post_format_link, get_post_format_slugs, get_post_format_string
Assign a format to a post
Source
<?php
function set_post_format( $post, $format ) {
$post = get_post($post);
if ( empty($post) )
return new WP_Error('invalid_post', __('Invalid post'));
if ( !empty($format) ) {
$format = sanitize_key($format);
if ( 'standard' == $format || !in_array( $format, array_keys( get_post_format_slugs() ) ) )
$format = '';
else
$format = 'post-format-' . $format;
}
return wp_set_post_terms($post->ID, $format, 'post_format');
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- Function Reference/set post format « WordPress Codex
Description. Set the post format of a post. This can be called and used anywhere if a post Object and the format is provided.
codex.wordpress.org - set_post_format (WordPress Function) - WPSeek.com
WordPress lookup for set_post_format, a WordPress Function. wpseek.com is a WordPress-centric search tool for developers and theme authors.
wpseek.com - custom taxonomy - Post Formats in the context of the Database ...
May 30, 2011 ... It can be set for the post by set_post_format() function. As with any taxonomy you can also use some deeper level function, but really there is no ...
wordpress.stackexchange.com - PHPXRef 0.7 : WordPress : Function Reference: set_post_format()
Function and Method Cross Reference. set_post_format(). Defined at: /wp- includes/post.php -> line 540. Referenced 7 times: ...
phpxref.ftwr.co.uk