• On line 94 of post-type-switcher.php the select is generated in the meta box without a blank option.

    While this works great in many cases, we are finding that if we use the filter ‘pts_post_type_filter’ to remove a few post types, this select just defaults to the first post type and switch the post to that on every save.

    For instance is we remove the post_type called ‘events’ from the available to switch to post_types then add a new event, when we save the event it is automatically converted to a post due to post being the first available option in the select.

    I was able to fix it by adding an empty valued option which does not convert the post type unless one is selected, or automatically adding an option for the current post type if not in the $post_types variable.

    https://www.ads-software.com/plugins/post-type-switcher/

Viewing 1 replies (of 1 total)
  • I second the suggestion of defaulting to a blank entry or the current post type being edited.

    One of my colleagues had installed this plugin when setting up a site for a client. I was not aware of it when it was moved over to production. The problem we had was that Woocommerce was also installed on this site and it uses custom post types to track order data. So whenever an order was updated, it was set to the ‘post’ post type and then lost from the orders section.

    It took a while to track down what was happening but glad it was a single plugin that was the culprit.

    Aside from that, this plugin is pretty handy. Thanks.

Viewing 1 replies (of 1 total)
  • The topic ‘Defaults To Post post_type’ is closed to new replies.