Skip to content

Instantly share code, notes, and snippets.

View Lonsdale201's full-sized avatar

Soczó Lonsdale201

View GitHub Profile
@Crocoblock
Crocoblock / data-store-api.md
Last active December 14, 2024 14:09
JetEngine Data Store API

Get store items, add items, remove items

Check if data store module active

returns true/false; call not earlier than 'init' action with the priority of 1

$module_active = jet_engine()->modules->is_module_active( 'data-stores' );
Get store factory

returns instance of \Jet_Engine\Modules\Data_Stores\Stores\Factory\

@ihslimn
ihslimn / jet-form-builder-star-field.html
Last active November 5, 2024 13:50
JetFormBuilder Star Field
<style>
:is(.star-field, .jet-form-builder__fields-group:has(.star-field-check)) {
display: flex !important;
flex-direction: row !important;
}
:is(.star-field, .jet-form-builder__fields-group:has(.star-field-check)) > .radio-wrap {
display: inline-block !important;
}
@Crocoblock
Crocoblock / cct-crud.md
Last active February 20, 2025 08:28
JetEngine CCT CRUD

Get/Create/Update/Delete CCT item

Check if CCT module active

$module_active = jet_engine()->modules->is_module_active( 'custom-content-types' );

Get type object and handler

$type_object is an instance of \jet-engine\includes\modules\custom-content-types\inc\factory.php \

@Crocoblock
Crocoblock / query-cct-items.php
Created October 28, 2022 10:07
JetEngine Query CCT items from DB
<?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
@Crocoblock
Crocoblock / register-relation.php
Last active March 15, 2025 20:55
JetEngine Relations: update items programmatically, register a relation programmatically
<?php
add_filter( 'jet-engine/relations/raw-relations', function( $relations ) {
$relations[999] = array(
'name' => 'User to post',
'parent_rel' => null,
'type' => 'many_to_many',
'is_legacy' => false,
'id' => 999,
@girafffee
girafffee / jet-fb-repeater-format-email.php
Last active January 21, 2025 10:25
Pretty formating repeater values in Send Email action content
<?php
/**
* Works in JetFormBuilder >= 2.1.0
*/
add_filter(
'jet-form-builder/send-email/template-repeater',
/**
* Verbose repeater items array
@MjHead
MjHead / jet-engine-cct-api.php
Last active November 19, 2024 16:30
API to interact with JetEngine CCT from directly PHP code
<?php
/**
* JetEngine CCT-related API functions to use in theme or plugin
*
* Theme usage - include get_theme_file_path( 'jet-engine-cct-api.php' );
* Plugin usage - include PLUGIN_PATH . 'path-to-file-inside-plugin/jet-engine-cct-api.php';
*/
/**