Closed danimalweb closed 7 years ago
Hi @danimalweb I have right records in database (stored in wp_options) https://cl.ly/k0iC
Is it possible one of the CPT args is not set correctly?
<?php
function cptui_register_my_cpts_designer_collections() {
/**
* Post Type: Designer Collections.
*/
$labels = array(
"name" => __( 'Designer Collections', 'tofino' ),
"singular_name" => __( 'Designer Collection', 'tofino' ),
);
$args = array(
"label" => __( 'Designer Collections', 'tofino' ),
"labels" => $labels,
"description" => "",
"public" => true,
"publicly_queryable" => true,
"show_ui" => true,
"show_in_rest" => false,
"rest_base" => "",
"has_archive" => true,
"show_in_menu" => true,
"exclude_from_search" => false,
"capability_type" => "post",
"map_meta_cap" => true,
"hierarchical" => false,
"rewrite" => array( "slug" => "designer_collections", "with_front" => true ),
"query_var" => true,
"menu_icon" => "dashicons-portfolio",
"supports" => array( "title", "editor", "thumbnail" ),
"taxonomies" => array( "collection_types" ),
);
register_post_type( "designer_collections", $args );
}
add_action( 'init', 'cptui_register_my_cpts_designer_collections' );
Here are a few images in the WP-Admin and Database.
@danimalweb I've created the new CPT (with your code), everything is ok https://cl.ly/k0fX
I don't know what to say :)
Ok thanks, I'll try and do a reduced test case at my end. Cheers.
Found my issue, I was assigning the Options to a manually created (via code) Options Page for that CPT and not using the one automatically created by the plugin.
Got it! Thank you for issue :)
Great plugin, this seems really useful. I'm having trouble pulling back the saved options in the code. I checked the database and my CTP Options are saving as options_fieldname and not cpt
Any ideas how I can debug this? In the WP-Admin I have my options pages for each CPT, and the saved data is there, but it looks like it's not stored in the DB correctly.
I did a few var_dumps in the plugin code and its finding the correct CPT, just not saving as.
Cheers!