Post Type Switcher adds a simple post-type drop-down to the post editor interface, allowing you to reassign any post to a new post type.
Customization
Use the pts_post_type_filter to enable all available post types:
add_filter( 'pts_post_type_filter', 'filter_pts_post_type_filter', 10, 1 );
/**
* Post Type Switcher: Filter Post Type Arguments
*
* By default, the post type select field only shows public post types. This
* can cause problems with native WordPress functionality, like the post type
* filter button on top of the post list screen, that (for some reason) causes
* all posts in the list to save to the post type, that is currently selected.
* Thus, if the actual post type is hidden, it switches all posts to anther post
* type, probably 'post', since it usually is the first in the list.
*/
function filter_pts_post_type_filter( $array ) {
// Enable all available post types by removing the default restrictions.
$array = array();
return $array;
};
If too many drop downs are appearing in the quick edit area, from about line 145 change the function to this:
/**
* Adds quickedit button for bulk-editing post types
*
* @since PostTypeSwitcher (1.2)
*/
public function quickedit( $column_name, $post_type ) {
switch( $column_name ) {
case 'post_type' :
?>
<fieldset class="inline-edit-col-right">
<div class="inline-edit-col">
<label class="alignleft">
<span class="title"><?php _e( 'Post Type' ); ?></span>
<?php wp_nonce_field( 'post-type-selector', 'pts-nonce-select' ); ?>
<?php $this->select_box(); ?>
</label>
</div>
</fieldset>
<?php
break;
}
}
Conflicts
- Admin Columns plugin (2018-07-11): Prevents Post Type Switcher’s bulk editing fieldset from showing up in the quick editing section of a post, making it impossible to bulk edit anything.
- ACF Pro: Removes images from media library if image field is used.
- Woocommerce Tab Manager