update_post_meta(); Updating Checkboxs

I am working on importing data into CustomPress - all is working fine. Im adding posts to custom post type, adding information to Custom Fields.

I have though a "CheckBox" Custom Field that has THREE options (its called "ct_Services_checkbox_c772") that I am unable to update.

I can not seem to figure out how to update each individual checkbox.

Currently trying: (not working)

update_post_meta( $post_id, 'ct_Services_checkbox_c772_1', true );
update_post_meta( $post_id, 'ct_Services_checkbox_c772_2', false );

Tried a few other ways too: (without success)
update_post_meta( $post_id, 'ct_Services_checkbox_c772_1', 1);

Any ideas? Im out of them.

  • Ash

    Hello H4U

    If you use our custompress plugin, then the custom fields should be auto saved on post save from admin editor screen.

    Still if you want to manually save it, then you need to look for the name attribute of those checkboxes. If you see the name is like "ct_Services_checkbox_c772[]" (with an arrow sign), then you should be able to save as following:

    update_post_meta( $post_id, '$_POST['ct_Services_checkbox_c772']' );

    Hope it helps! Please feel free to ask more questions if you have any.

    Have a nice day!


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.