Skip to content

Instantly share code, notes, and snippets.

@Crocoblock
Crocoblock / code.php
Last active December 11, 2024 14:08
JetEngine Change wrapper tags to <ul> <li> in Listing Grid
<?php
class JEC_Change_Tags {
public function __construct() {
add_filter( 'jet-engine/listing/render/jet-listing-grid/settings', array( $this, 'apply_settings' ) );
add_filter( 'jet-engine/listing/grid/nav-widget-settings', array( $this, 'nav_settings' ), 10, 2 );
add_filter( 'jet-engine/listing/render/default-settings', array( $this, 'default_settings' ) );
}
@Qubadi
Qubadi / gist:539d5682527ca4c13efd85e9ca670b7f
Last active September 5, 2024 12:06
JetFormBuilder change display message to Popup
UPDATED: 22.08.2024
Copy the following HTML code and create a HTML snippet using your snippet plugins.
Paste the code into the plugin and save it.
Update the targetPages array by replacing 'contact' and 'contact-2' with your desired page slugs. The array supports multiple pages, so you can easily add or remove slugs as needed.
_________________________________________
<style>
/* Overlay Styling */
@SteveBarnett
SteveBarnett / notes.md
Last active October 6, 2023 01:45
OBS dual wield / dual video and audio

Send a second video using Full-screen Projector

  • Right click on the Preview, "Full-screen Projector (Preview)" menu item.
  • Choose the second screen from the list.

Send a second audio using Monitor

  • Go Settings > Audio. In Advanced, set the Monitoring Device to the second screen.
  • Go to Advanced Audio Properties (in the Audio mixer panel click the Cog, or the three dots button next to an audio source).
  • Choose "Monitor and Output" in the Audio Monitoring column for the correct audio source.
@Crocoblock
Crocoblock / jfb-call-hook.php
Last active December 20, 2024 13:32
JetFormBuilder Call Hook action
<?php
add_action( 'jet-form-builder/custom-action/test-hook', function( $request, $action_handler ) {
//get value of field field1
$value = $request['field1'];
//or using jet_fb_context()->resolve_request()
$value = jet_fb_context()->resolve_request()['field1'];
@Crocoblock
Crocoblock / register-options-page.php
Last active June 29, 2023 09:04
JetEngine Register Options page programmatically
<?php
add_action( 'init', 'register_my_custom_options_page', 20 );
function register_my_custom_options_page() {
$args = array (
'slug' => 'option-slug',
'labels' =>
array (
@Crocoblock
Crocoblock / jet-engine-filter-repeater.php
Created January 23, 2023 15:38
JetEngine Filter repeater items before output
<?php
add_filter( 'jet-engine/listings/dynamic-repeater/pre-get-saved', function( $items, $settings ) {
$classes = $settings['_css_classes'] ?? '';
if ( ! $classes ) {
return false;
}
@Crocoblock
Crocoblock / add-meta-box.php
Last active August 7, 2024 04:28
JetEngine Register meta box for CPT/taxonomy/user programmatically
<?php
add_action( 'jet-engine/meta-boxes/register-instances', function( $meta ) {
//all field types are given for the reference, you can add any amount of fields of any type
$meta_fields = array (
array (
'title' => 'reference-text',
'name' => 'reference-text',
@Crocoblock
Crocoblock / dynamic-field-custom-source.php
Created October 7, 2022 12:10
Add new Source to JetEngine Dynamic Field
<?php
class Dynamic_Filed_Source_Maybe_Unserialize {
public function __construct() {
add_filter( 'jet-engine/listings/dynamic-field/field-value', array( $this, 'process_value' ), 0, 2 );
add_filter( 'jet-engine/listings/data/sources', array( $this, 'add_source' ) );
}
public function process_value( $value, $settings ) {
@Crocoblock
Crocoblock / register-relation.php
Last active November 5, 2024 13:50
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,
@Crocoblock
Crocoblock / get-related.md
Last active September 10, 2024 06:08
Get JetEngine Related Items programmatically / Update related items / Get/Update relation meta