wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
set_post_type [ WordPress Function ]
set_post_type ( $post_id = 0, $post_type = 'post' )
| Parameter: |
|
| Nutzt: |
|
| Gibt zurück: |
|
| Definiert in: |
|
Ähnliche Funktionen: 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;
}
?>
Beispiele [ wp-snippets.com ]
Top Google Suchergebnisse
- 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 - #4844 (Need set_post_type API) – WordPress Trac
Currently there is a get_post_type function, which with other functions allows plugins to use custom "post_type"s. There should be API to set the post_type ...
core.trac.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