Wordpress Today Agency Logo

How to Update a JetEgine Custom Content Type using PHP code(CCT)

A Simple Guide to Deleting Custom Types in JetEngine using PHP | WordPress Today Agency

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);
				
			

Leave a Reply

Your email address will not be published. Required fields are marked *


Leave a Reply

Your email address will not be published. Required fields are marked *


Related Posts

Wordpress Today Agency Logo

Let’s talk about your project and how it aligns with your business strategy.
You can also email us at hello@wordpresstoday.agency

 


Wordpress Today Agency Logo

Let’s talk about your project and how it aligns with your business strategy.
You can also email us at contact@wordpresstoday.agency

 


Wordpress Today Agency Logo

Let’s talk about your project and how it aligns with your business strategy.
You can also email us at contact@wordpresstoday.agency

 


Wordpress Today Agency Logo

Let’s talk about your project and how it aligns with your business strategy.
You can also email us at contact@wordpresstoday.agency

 


Wordpress Today Agency Logo

Let’s talk about your project and how it aligns with your business strategy.
You can also email us at contact@wordpresstoday.agency

 


Wordpress Today Agency Logo

Let’s talk about your project and how it aligns with your business strategy.
You can also email us at contact@wordpresstoday.agency

 


Wordpress Today Agency Logo

Let’s talk about your project and how it aligns with your business strategy.
You can also email us at contact@wordpresstoday.agency