How to Update a JetEgine Custom Content Type using PHP code(CCT)
Here is the PHP code for updating JetEgine custom post type
$cct_slug = "test"; // Name of the Custom Content Type. Don’t add “jet-cct-“ as JetEngine will add it by default.
$cct_id = 10; //The ID of the Custom Content Type item you want to update
$content_type = \Jet_Engine\Modules\Custom_Content_Types\Module::instance()->manager->get_content_types(
$cct_slug
);
$new_data = [
"metafield1" => "value",
"metafield2" => "value",
];
$where = [
"_ID" => $cct_id,
];
if (!$content_type) {
return;
}
$content_type->db->update($new_data, $where);
Post Views: 334