set_post_type [ WordPress Function ]
set_post_type ( $post_id = 0, $post_type = 'post' )
| Parameters: |
|
| Uses: |
|
| Returns: |
|
| Defined at: |
|
Soorgelijke functies: get_post_type, get_post_types, get_post_time, register_post_type, get_post_mime_type
Updates the post type for the post ID.
The page or post cache will be cleaned for the post ID.
Source
<?php
function set_post_type( $post_id = 0, $post_type = 'post' ) {
global $wpdb;
$post_type = sanitize_post_field('post_type', $post_type, $post_id, 'db');
$return = $wpdb->update( $wpdb->posts, array('post_type' => $post_type), array('ID' => $post_id) );
clean_post_cache( $post_id );
return $return;
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- Function Reference/set post type « WordPress Codex
Description. Updates the post type for the post ID. The page or post cache will be cleaned for the post ID. @uses $wpdb name a few.
codex.wordpress.org - WordPress › Support » Tags — set_post_type
Forums. Username or Email Address Password (forgot?) Register · WordPress › Support » set_post_type. Tag: set_post_type Add New » ...
wordpress.org - set_post_type (WordPress Function) - WPSeek.com
WordPress lookup for set_post_type, a WordPress Function. wpseek.com is a WordPress-centric search tool for developers and theme authors.
wpseek.com - PHPXRef 0.7 : WordPress : Function Reference: set_post_type()
Function and Method Cross Reference. set_post_type(). Defined at: /wp-includes/ post.php -> line 1383. No references found.
phpxref.ftwr.co.uk