Skip to content

Instantly share code, notes, and snippets.

View Lonsdale201's full-sized avatar

Soczó Lonsdale201

View GitHub Profile
@Lonsdale201
Lonsdale201 / gist:8570877cfc136192c727bae61b64efee
Last active April 29, 2024 13:38
JetEngine - Calculated callback Date difference
// copy this code in the child theme functions.php or a specific code plugin like FluentSnippets
// For the code to work, you need to install the Calculated Callback Add-on addons
// Plugin: https://github.com/MjHead/jet-engine-calculated-callback
// Plugin desc: https://crocoblock.com/knowledge-base/jetengine/calculated-callback-add-on/#custom-callback
// when you pasted the code, open the Elementor editor, and place the Dynamic Field widget, enable the Filter Field output
// Note that this calculation works correctly only for : Date meta
// The order matters. The first meta argument will be compared with the second.
// in the dropdown, select the Calculated field Callback
@Lonsdale201
Lonsdale201 / gist:89668ae90c00cd40bd3005b9fed25eff
Last active March 14, 2024 15:59
JetEngine - Calculated callback Datetime difference
// copy this code in the child theme functions.php or a specific code plugin like FluentSnippets
// For the code to work, you need to install the Calculated Callback Add-on addons
// Plugin: https://github.com/MjHead/jet-engine-calculated-callback
// Plugin desc: https://crocoblock.com/knowledge-base/jetengine/calculated-callback-add-on/#custom-callback
// when you pasted the code, open the Elementor editor, and place the Dynamic Field widget, enable the Filter Field output
// Note that this calculation works correctly only for : DateTime meta
// The order matters. The first meta argument will be compared with the second.
// in the dropdown, select the Calculated field Callback
@Lonsdale201
Lonsdale201 / gist:1828802569ece230a15463b51bf62aa4
Created March 17, 2024 13:48
JetEngine - Dynamic Visibility - Tutor LMS - User enrolled current course
// place the code in the child theme functions.php or a custom code snippets plugin.
// This snippet will register a new dynamic visibility condition
// Work with only TUTOR LMS
// plugin : https://wordpress.org/plugins/tutor/
add_action( 'jet-engine/modules/dynamic-visibility/conditions/register', function( $conditions_manager ) {
class Tutor_LMS_User_Enrolled_Course_Visibility extends \Jet_Engine\Modules\Dynamic_Visibility\Conditions\Base {
public function get_id() {
@Lonsdale201
Lonsdale201 / code
Last active May 9, 2024 08:25
JetEngine - Calculated callback Lowest highset between calc
// copy this code in the child theme functions.php or a specific code plugin like FluentSnippets
// This code Based on the meta values you enter (you should enter at least 3), it will find the smallest and largest values and output them.
// For the code to work, you need to install the Calculated Callback Add-on addons
// Plugin: https://github.com/MjHead/jet-engine-calculated-callback
// Plugin desc: https://crocoblock.com/knowledge-base/jetengine/calculated-callback-add-on/#custom-callback
// when you pasted the code, open the Elementor editor, and place the Dynamic Field widget, enable the Filter Field output
// in the dropdown, select the Calculated field Callback
@Lonsdale201
Lonsdale201 / code
Created May 9, 2024 08:24
JetEngine - Calculated callback - Calculate Hours and Minutes
// This code can convert the number values to Hours, and minutes.
// Example, your meta store: "125" this calc can output to: 2h5m so 2 hours, and 5 minutes
// copy this code in the child theme functions.php or a specific code plugin like FluentSnippets
// For the code to work, you need to install the Calculated Callback Add-on addons
// Plugin: https://github.com/MjHead/jet-engine-calculated-callback
// Plugin desc: https://crocoblock.com/knowledge-base/jetengine/calculated-callback-add-on/#custom-callback
// when you pasted the code, open the Elementor editor, and place the Dynamic Field widget, enable the Filter Field output
// in the dropdown, select the Calculated field Callback
@Lonsdale201
Lonsdale201 / code
Created May 12, 2024 07:36
JetEngine - Calculated callback - Age calc
// This code uses the date meta to calculate how many years old. The calculation is done using
// the year from the given meta and the current date. The returned number simply returns the years.
// Can also be used with user listings.
// Ideally, the user should be able to specify when they were born, so that you can use the
// calculation to return how old they are at the moment.
// copy this code in the child theme functions.php or a specific code plugin like FluentSnippets
// For the code to work, you need to install the Calculated Callback Add-on addons
// Plugin: https://github.com/MjHead/jet-engine-calculated-callback
@Lonsdale201
Lonsdale201 / code
Created May 21, 2024 20:17
JetEngine Custom macro - Fluent CRM get Contact users
// place the code in the child theme functions.php or a custom code snippets plugin like FluentSnippets
// how to use
// Create a new Users Query in the Query builder
// Go to the Include/Exclude section
// click the Include section dynamic icon and choose the Fluent CRM / WP Users macro
// HELP IMAGE https://prnt.sc/06FFNY9E24Sg
// This macro returns the identifiers of users who can be found in fluentCRM as both contacts and wordpress users.
// It will not return users who are not registered on your WordPress site. The subscription status is independent for this macro.
@Lonsdale201
Lonsdale201 / code
Created May 21, 2024 20:20
JetEngine Custom macro - Fluent CRM get Contact users with selectable status
// place the code in the child theme functions.php or a custom code snippets plugin like FluentSnippets
// how to use
// Create a new Users Query in the Query builder
// Go to the Include/Exclude section
// click the Include section dynamic icon and choose the Fluent CRM Users with Status
// HELP IMAGE https://prnt.sc/06FFNY9E24Sg
// This macro returns the identifiers of users who can be found in fluentCRM as both contacts and wordpress users.
// In addition you can select which subscription state you want to retrieve users from, you can retrieve users from all default states.
@Lonsdale201
Lonsdale201 / code
Created May 21, 2024 20:21
JetEngine Custom macro - Fluent CRM get Contact users with selectable list
// place the code in the child theme functions.php or a custom code snippets plugin like FluentSnippets
// how to use
// Create a new Users Query in the Query builder
// Go to the Include/Exclude section
// click the Include section dynamic icon and choose the Fluent CRM Users with List
// HELP IMAGE https://prnt.sc/06FFNY9E24Sg
// This macro returns the identifiers of users who can be found in fluentCRM as both contacts and wordpress users.
// You can also select which CRM list you want to retrieve the users from
@Lonsdale201
Lonsdale201 / code
Created May 21, 2024 20:23
JetEngine Custom macro - Fluent CRM get Contact users with selectable contact type
// place the code in the child theme functions.php or a custom code snippets plugin like FluentSnippets
// how to use
// Create a new Users Query in the Query builder
// Go to the Include/Exclude section
// click the Include section dynamic icon and choose the Fluent CRM Users with Contact Type
// HELP IMAGE https://prnt.sc/06FFNY9E24Sg
// This macro returns the identifiers of users who can be found in fluentCRM as both contacts and wordpress users.
// In addition, you can select which Contact type you want to retrieve users from.