2013-02-17 87 views
0

我的工作中,我在下面的佈局WordPress的重命名自定義後類型

function my_custom_settings(){ 
    register_post_type('my_custom_post_type',array( 
     'labels' => array( 
     'name' => __('My Custom Post Type'), 
     'singular_name' => __('My Custom Post Type') 
    ), 
     'public' => true, 
     'menu_position' => 6, 
     'rewrite' => array(
     'slug' => 'my-custom-post-type', 
     'with_front' => true, 
    ))); 

    register_taxonomy('my_custom_taxonomy','my_custom_post_type',array( 
     'hierarchical' => true, 
     'label' => 'My Custom Taxonomy', 
     'query_var' => true, 
     'rewrite' => array('slug' => 'my-custom-taxonomy') 
    )); 
} 
add_action('init','my_custom_settings'); 

我想知道是否有可能更改命名空間增加了許多自定義文章類型的分類WordPress的數據庫模型的實際註冊帖子類型(例如my_custom_post_typemy_other_custom_post_type),同時保持數據庫關係和帖子的完整性。我的問題是很多帖子類型都有類似的名稱空間,這些名稱空間變得令人困惑,所以我想我需要知道具體的數據庫字段要更改,並且想知道是否有人知道位置和/或是否存在重命名自定義帖子類型。提前致謝!

回答

3

沿着這些線?

UPDATE `wp_posts` SET `post_type` = '<new post type name>' WHERE `post_type` = '<old post type name>';