Created
October 28, 2022 10:07
-
-
Save Crocoblock/276514e4c2db54f832d394e57cd6ab3b to your computer and use it in GitHub Desktop.
JetEngine Query CCT items from DB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//get_content_types() should be called on init with priority 12 or higher, or at any action later than init (there are no registered CCTs before that action) | |
$result = array(); | |
$content_type = \Jet_Engine\Modules\Custom_Content_Types\Module::instance()->manager->get_content_types( 'content_type_slug' ); | |
if ( ! $content_type) { | |
return $result; | |
} | |
//$args is an array of arguments | |
//like | |
$args = array ( | |
array ( | |
'field' => 'num1', | |
'operator' => '=', | |
'value' => 0, | |
'type' => 'integer', | |
), | |
array ( | |
'field' => 'cct_status', | |
'operator' => '=', | |
'value' => 'publish', | |
'type' => 'CHAR', | |
), | |
); | |
$result = $content_type->db->query( $args, $limit, $offset, $order ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment