Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Eliot Akira

    (@miyarakira)

    Hello,

    Thank you for letting me know about it. I use Custom Post Type UI, but hadn’t tried the latest version yet. The change log shows that there has been some restructuring of how post types and taxonomies are stored in the database. I suspect that the following point may be causing your issue:

    – Added function that automatically converts 0.8.x and down settings to new setting arrangement

    From the other support thread, I see that recreating the post types did not work. Probably the contents of the previous setup got “disconnected” from the new settings.

    I think the best is to work with the plugin authors to find out where things went wrong in the migration from 0.8.x to 0.9.0.

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    CPTUI dev here,

    ” Added function that automatically converts 0.8.x and down settings to new setting arrangement”

    Yes.

    My conversion code for the old option to new:

    if ( false === get_option( 'cptui_post_types' ) && ( $post_types = get_option( 'cpt_custom_post_types' ) ) ) {
    
    	$new_post_types = array();
    	foreach( $post_types as $type ) {
            	$new_post_types[ $type['name'] ]                = $type; #This one assigns the # indexes       # Named arrays are our friend.
            	$new_post_types[ $type['name'] ]['supports']    = ( !empty( $type[0] ) ) ? $type[0] : array(); # Especially
    		$new_post_types[ $type['name'] ]['taxonomies']  = ( !empty( $type[1] ) ) ? $type[1] : array(); # for multidimensional
    		$new_post_types[ $type['name'] ]['labels']      = ( !empty( $type[2] ) ) ? $type[2] : array(); # arrays
    		unset(
    			$new_post_types[ $type['name'] ][0],
    			$new_post_types[ $type['name'] ][1],
    			$new_post_types[ $type['name'] ][2]
    		); # Remove our previous indexed versions.
    	}
    
    	$retval = update_option( 'cptui_post_types', $new_post_types );
    }

    Intended to remove the old numeral indexed version and remap to a named index. Similar setup for the taxonomies option.

    Plugin Author Eliot Akira

    (@miyarakira)

    I see, it’s a very straight-forward conversion and don’t see any room for error. So, it seems that comparing the old and new option values should reveal some useful information of what happened and why the posts became disconnected. The good thing is that the content itself is safe, so it’s only a matter of declaring the existing structure in the new syntax.

    By the way, I’m a long-time fan of Custom Post Type UI – so easy to use, and provides a fundamental feature of using WordPress as a CMS. I’m looking forward to trying out the updated version.

    Plugin Author Eliot Akira

    (@miyarakira)

    @crzyhrse – I recommend the plugin Adminer for inspecting the database, specifically the option values on the previous and current versions of your site. If you look under select -> wp_options, the old option name is cpt_custom_post_types and new one cptui_post_types. These two values should show what is happening with the post type in question.

    Thread Starter crzyhrse

    (@crzyhrse)

    Thanks Eliot,

    I’ve a good ways to go to begin to understand and be comfortable within the database, and this plugin which I’ve just been trying out offers me some new ways to explore into it…

    Kind regards…

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘issue with CPT UI…’ is closed to new replies.