This file contains 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
// 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 |
This file contains 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
// 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 |
This file contains 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
// 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 |
This file contains 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
// 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() { |
This file contains 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
// 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 |
This file contains 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
// 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 |
This file contains 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
// copy this code in the child theme functions.php or a specific code plugin like FluentSnippets | |
add_action( 'user_register', 'auto_enroll_user_to_course', 10, 1 ); | |
function auto_enroll_user_to_course( $user_id ) { | |
if ( ! is_wp_error( $user_id ) ) { | |
$course_ids = array( 131 ); // Course ID, or ID's user separate comme if you want to add multiple id. | |
if ( !is_array( $course_ids ) ) { | |
$course_ids = array( $course_ids ); | |
} |
This file contains 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
// place the code in the child theme functions.php or a custom code snippets plugin like Fluent Snippts etc.. | |
// This conditions required the FluentCRM plugin to be installed and activated on your site. This Conditions only work with | |
// LOGGED IN USERS + user need to Contant in your CRM | |
// https://fluentcrm.com/ | |
// https://wordpress.org/plugins/fluent-crm/ | |
// Only Elementor | |
// HOW TO | |
// Go to your , widget container etc, open the Dynamic Visibility modul, and scroll down and select the Fluent CRM Lists option | |
// In the next select field, choose one or more Lists (Internal operator OR) | |
// don't see any listings? That's because you haven't created them yet. |
This file contains 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
// Reference by default https://gist.github.com/Crocoblock/25125c7db9b19c60b1043061015556d0 | |
// In the jetformbuilder Select field - use the Advanced section - Class field name, and add: select-limit | |
// Dont forget to enable the multiple option | |
// place the code in the child theme functions.php or a custom code snippets plugin. | |
// You can define if the user not logged in how many select item can check. This is the : 'guest' => 1, | |
// HOW TO | |
// In the $limits = [ add your role name like 'mycustomrole" => 4, where the "mycustomrole" is your role cap name, and the "4" is the limit | |
// Dont forget to target your select field, in the form gutenberg editor like the image: https://prnt.sc/Q4fqdpj3vgTH |
This file contains 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
// Reference by default https://gist.github.com/Crocoblock/d8bcacb6c851ae670bc0514f2f9173d6 | |
// In the jetformbuilder checkbox field - use the Advanced section - Class field name, and add: check-limit | |
// place the code in the child theme functions.php or a custom code snippets plugin. | |
// You can define if the user not logged in how many checkbox can check. This is the : 'guest' => 1, | |
// HOW TO | |
// In the $limits = [ add your role name like 'mycustomrole" => 4, where the "mycustomrole" is your role cap name, and the "4" is the limit | |
// Dont forget to target your checkbox field, in the form gutenberg editor like the image: https://prnt.sc/FjqDLNL_q78m | |
// CSS Class name: check-limit |