Update from 1.0.5 to 1.1.1
-
Hi,
I have a bunch of sites running on CPT UI and it seems like I get the same result whenever I update the plug on the site.All of the custom post types just disappear. I am running the most current version of wordpress and have all the other plugins disabled.
Any idea what I can try to fix this?
I have tried deleting the post type data and re-importing them. I have tried tweaking the setting for the post types. Nothing seems to work.
Just so I am clear. They are showing up in the plugin setting they are just not showing up in the left menu so I can see and edit the posts inside.
-
This is happening after you do the update to 1.1.1?
The update should be a LOT less painful than the 0.x update as I’m not messing with setting conversion this time. However, stranger things have happened.
Have you made sure they’re set to still “show UI” similar?
I have no idea. Where do I find this setting? I did not change anything. It’s across the board doing the same thing on every site. Let me know If I can help get to the root of this.
You’d have to go through the settings for each post type you’ve registered with our plugin and check for it. It’s one of the UI elements available for the settings used.
Ok I think I figured it out. The box was in fact checked.
The issue seems to happened because I manually added Custom “Supports” in the functions file.
register_post_type( ‘procedure’,
array(
‘labels’ => array(
‘name’ => __( ‘procedure’ ),
‘singular_name’ => __( ‘procedure’ ),
),
‘supports’ => array( ‘title’, ‘editor’, ‘genesis-seo’, ‘thumbnail’,’genesis-cpt-archives-settings’ ),
)If I remove this code and add it to the plugin it seems to work. I wonder if there is a work around without changing the functions file. I have this access a bunch of sites so I am trying not to change the code base.
hmm.
It’d be awesome if you could help test the custom supports field that I added in 1.1.x, just as an aside. I understand needing to keep it more global as well. Just if you’re able to.
So that snippet alone above is doing the registering of the provided post type, but it’s causing it to not show up in the menu? Outside of our plugin completely? Or are there some sort of ties to CPTUI with this procedure post type?
Yes.
Here is the full code:
https://pastebin.com/8kdfvaXqWhen I remove this code it fixes the CPT. Then I add this to the plugins custom area I get my archive area for the CPT.
I wonder if I can fix this issue without removing this code from all our sites.
Could you also provide the export for any post types you have registered with our plugin?
I sure can.
{“procedure”:{“name”:”procedure”,”label”:”Procedures”,”singular_label”:”Procedure”,”description”:”List of Procedure at this office.”,”public”:”true”,”show_ui”:”true”,”has_archive”:”true”,”has_archive_string”:””,”exclude_from_search”:”false”,”capability_type”:”post”,”hierarchical”:”true”,”rewrite”:”true”,”rewrite_slug”:””,”rewrite_withfront”:”true”,”query_var”:”true”,”menu_position”:”5″,”show_in_menu”:”true”,”show_in_menu_string”:””,”menu_icon”:”dashicons-plus-alt”,”supports”:[“title”,”editor”,”custom-fields”,”thumbnail”,”page-attributes”,”post-formats”],”taxonomies”:[“procedure-types”],”labels”:{“menu_name”:”Procedures”,”all_items”:”All Procedures”,”add_new”:”Add Procedure”,”add_new_item”:”Add New Procedure”,”edit”:”Edit”,”edit_item”:”Edit Procedure”,”new_item”:”New Procedure”,”view”:”View”,”view_item”:”View Procedure”,”search_items”:”Search Procedure”,”not_found”:”No Procedure foun”,”not_found_in_trash”:”No Procedure found in Trash”,”parent”:”Parent Procedure”}},”testimonial”:{“name”:”testimonial”,”label”:”Testimonials”,”singular_label”:”Testimonial”,”description”:”See how our practice is changing lives all over our state.”,”public”:”true”,”show_ui”:”true”,”has_archive”:”true”,”has_archive_string”:””,”exclude_from_search”:”false”,”capability_type”:”post”,”hierarchical”:”true”,”rewrite”:”true”,”rewrite_slug”:””,”rewrite_withfront”:”true”,”query_var”:”true”,”menu_position”:”6″,”show_in_menu”:”true”,”show_in_menu_string”:””,”menu_icon”:”dashicons-groups”,”supports”:[“title”,”custom-fields”,”thumbnail”],”taxonomies”:[“testimonial-types”],”labels”:{“menu_name”:”Testimonials”,”all_items”:”All Testimonials”,”add_new”:”Add New”,”add_new_item”:”Add New Testimonial”,”edit”:”Edit”,”edit_item”:”Edit Testimonial”,”new_item”:”New Testimonial”,”view”:”View”,”view_item”:”View Testimonial”,”search_items”:”Search Testimonial”,”not_found”:”No Testimonial found”,”not_found_in_trash”:”No Testimonial found in Trash”,”parent”:”Parent Testimonial”}},”information”:{“name”:”information”,”label”:”Patient Information”,”singular_label”:”Patient Information”,”description”:”Patient Information”,”public”:”true”,”show_ui”:”true”,”has_archive”:”true”,”has_archive_string”:””,”exclude_from_search”:”false”,”capability_type”:”post”,”hierarchical”:”false”,”rewrite”:”true”,”rewrite_slug”:””,”rewrite_withfront”:”true”,”query_var”:”true”,”menu_position”:”5″,”show_in_menu”:”true”,”show_in_menu_string”:””,”menu_icon”:”dashicons-clipboard”,”supports”:[“title”,”editor”,”trackbacks”,”thumbnail”,”post-formats”],”taxonomies”:[],”labels”:{“menu_name”:””,”all_items”:””,”add_new”:””,”add_new_item”:””,”edit”:””,”edit_item”:””,”new_item”:””,”view”:””,”view_item”:””,”search_items”:””,”not_found”:””,”not_found_in_trash”:””,”parent”:””}},”instruction”:{“name”:”instruction”,”label”:”Instructions”,”singular_label”:”Instruction”,”description”:”Get instructions on pre\/post operative procedures.”,”public”:”true”,”show_ui”:”true”,”has_archive”:”true”,”has_archive_string”:””,”exclude_from_search”:”false”,”capability_type”:”post”,”hierarchical”:”true”,”rewrite”:”true”,”rewrite_slug”:”instructions”,”rewrite_withfront”:”true”,”query_var”:”true”,”menu_position”:”7″,”show_in_menu”:”true”,”show_in_menu_string”:””,”menu_icon”:”dashicons-welcome-learn-more”,”supports”:[“title”,”editor”,”custom-fields”,”page-attributes”],”taxonomies”:[],”labels”:{“menu_name”:”Instructions”,”all_items”:”All Instructions”,”add_new”:”Add New”,”add_new_item”:”Add New Instruction”,”edit”:”Edit”,”edit_item”:”Edit Instructions”,”new_item”:”New Instructions”,”view”:”View”,”view_item”:”View Instruction”,”search_items”:”Search Instruction”,”not_found”:”No Instructions found”,”not_found_in_trash”:”No Instructions found in Trash”,”parent”:”Parent Instructions”}}}
Hmm.
From what I can see in WP core code, the “Public” option is default false, despite my thoughts that it defaulted to true and CPTUI defaults to true with it.
So, your functions.php versions aren’t providing at least the public flag, which is making it not public, and thus not showing the UI at all
The following would work and the change would need to be applied to all involved:
register_post_type( 'testimonial', array( 'labels' => array( 'name' => __( 'testimonial' ), 'singular_name' => __( 'testimonial' ), ), 'supports' => array( 'title', 'editor', 'genesis-seo', 'thumbnail','genesis-cpt-archives-settings' ), 'public' => true ) );
I’m now faced with the fact that that setting is wrong in our plugin. However, I made simply make note of it for users and leave as is. I don’t want to risk breaking existing installs.
Ok So I think I hear you saying all I need to do is add ‘public’ => true to the functions for each type and it will show up?
That would be good new for me. seems like a simple fix. Yes I would need to do it to all the sites but I guess that life.
Yep, without explicitly passing the ‘public’ parameter, it’s defaulting to boolean false, and thus no UI or anything for the post type post management.
Not sure exactly what you have going on, but if all the sites are reading from the same functions.php file, then it should be pretty quick. If they all have their own, then there would be the extra work.
That said, if you wanted to use CPTUI to generate all the required code, you could. We have both the “Get code” feature that displays the code version to register things via external sources like the functions.php file, and also the import/export features that would allow for quick import in all the sites with matching settings. You’d just have to remember to re-do in each if you need to make matching changes. You wouldn’t lose the posts already created in each, as those are in the wp_posts table and not affected by the CPTUI settings.
Just some food for thought for you.
- The topic ‘Update from 1.0.5 to 1.1.1’ is closed to new replies.