Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Solved.

    I created my CPT using http://generatewp.com/post-type/.

    The generated code has the name of the CPT with the first letter capitalized, while the name of the SLUG is the same name, but with the first letter lowercase!

    The interface generated with CMB2 appeared on the administration page (add / edit) of the CPT, but the data entered in the various fields were not saved.

    WRONG:

    'object_types' => array( 'Corso', ), // Post type

    CORRECT:
    'object_types' => array( 'corso', ), // Post type

    Thank you Michael!
    Have a nice day.

    Hi Michael,
    same issue here.
    If I use CMB2 custom fields with pages it works! (in the example the prefix is _cmb2_)
    mysql> select count(meta_id) from wp_postmeta where meta_key like ‘_cmb2_%’;
    +—————-+
    | count(meta_id) |
    +—————-+
    | 35 |
    +—————-+
    1 row in set (0.00 sec)

    If I use CMB2 with a custom post type, the value entered into the custom fields are not saved! (in the example the prefix is _corso_)
    mysql> select count(meta_id) from wp_postmeta where meta_key like ‘_corso_%’;
    +—————-+
    | count(meta_id) |
    +—————-+
    | 0 |
    +—————-+
    1 row in set (0.00 sec)

    After this I used your example.
    With pages it works.
    With my own CPT it doesn’t.

    What could it be?
    Do you have any example with CPT?

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)