Skip to content

Instantly share code, notes, and snippets.

View Lonsdale201's full-sized avatar

Soczó Lonsdale201

View GitHub Profile
@Lonsdale201
Lonsdale201 / code
Created June 25, 2024 10:52
JetFormBuilder - Call hook - Create FluentCRM List
// place the code in the child theme functions.php or a custom code snippets plugin, like FluentSnippets
// What do this code
// Using a call hook in the JetFormBuilder, if the form is submitted successfully,
// a new list is created in fluentcrm. The list name is given by the value of a text field of your choice.
// If there is already a list with this name, the hook will not be triggered, i.e. it will not be overwritten or modified.
// HOW TO USE
// Just rewrite the marked parts of the code to take the value from the text field of your choice (you need the form field name)
@Lonsdale201
Lonsdale201 / code
Created June 10, 2024 19:28
JetEngine - JetFormBuilder - Call hook form action - Cron event + CCT user relation query - programmed relation creator
// place the code in the child theme functions.php or a custom code snippets plugin, like FluentSnippets
// What do this code
// In JetFormbuilder, you submit a form that calls a call hook aciton.
// Our code creates a personal cron for each user, which is currently set to a 1 minute run time in the code.
// After this expires, the system will go through all the elements of a given CCT and see
// if the user has any of them associated with a relation. It checks only those that are not already connected,
// then randomly selects one, and programmatically performs a relation connection.
// The code logs everything in the wp log file, so you can review the code from start to finish.
@Lonsdale201
Lonsdale201 / code
Last active June 7, 2024 06:26
Elementor Form - Fluent CRM Contact validator
// This code checks if the visitor's email address is already in your fluentCRM database as a contact
// based on the target email field, if it is, it will give you feedback and the submission will not run.
// place the code in the child theme functions.php or a custom code snippets plugin, like FluentSnippets
// Change the $email_field_id = 'email'; email with your field id
// You need to set a name for your form: if ($form_name !== 'FluentForm') {
// HELP IMAGE https://prnt.sc/5rsOUX84ALYX
// HELP IMAGE: https://prnt.sc/a1FIhRDVZ9tA
@Lonsdale201
Lonsdale201 / code
Created June 5, 2024 20:35
JetFormBuilder - Call hook check badwords (banlist)
// This hook will connect to a specified field and check its contents.
// It checks the specified "dictionary" to see if there are any words that are in the banned list.
// If so, it does not run through the form, but returns failed. A custom message can be added.
// place the code in the child theme functions.php or a custom code snippets plugin, like FluentSnippets
// How to use. Go to your jetformbuilder form. Add a new Call hook post submit actions top of the action list. Paste the following hook name:
// badword-validator
// HELP IMAGE: https://prnt.sc/R4E5mMrAVOSA
// paste the following code:
@Lonsdale201
Lonsdale201 / code
Last active May 31, 2024 12:55
JetEngine - Dynamic visibility - Is Front Page
// place the code in the child theme functions.php or a custom code snippets plugin.
// Best usage in the Listing Grid
// Open an widget, dynamic visibility, and search the Is Front page visibility under the Custom category.
add_action( 'jet-engine/modules/dynamic-visibility/conditions/register', function( $conditions_manager ) {
class Is_Front_Page_Condition extends \Jet_Engine\Modules\Dynamic_Visibility\Conditions\Base {
public function get_id() {
return 'is-front-page';
@Lonsdale201
Lonsdale201 / code
Created May 28, 2024 09:30
JetEngine Custom macro - Empty terms
// place the code in the child theme functions.php or a custom code snippets plugin like FluentSnippets
// how to use
// Create a new Terms Query in the Query builder
// Go to the Include/Exclude section
// click the Include section dynamic icon and choose the Empty terms option, and select whitch terms want to use
add_action( 'jet-engine/register-macros', function() {
class Empty_Terms_Macro extends \Jet_Engine_Base_Macros {
@Lonsdale201
Lonsdale201 / code
Last active May 27, 2024 14:09
JetEngine - Data Store - Store item on view - Update custom meta
// This code monitors a given data store type (Store item on view),
// and updates and replaces it with the value stored in the store in a given meta (number based) programmed way.
// It's ideal if you want to count the number of times a post has been viewed, and want to continuously transfer the value to a meta
// (so you can do a popular sorting filter, for example)
// place the code in the child theme functions.php or a custom code snippets plugin like FluentSnippets
// how to use
// Create a new Data store - enable the "Count Items", and "Store item" on view option, and choose post type
// Create a number type meta (jetengine, or other plugins, or php)
// In the Number meta, recommended to set a default 0 value
// replace the "megtekintes" with your data store SLUG (you need to replace in two places top of the code, and bottom of the code !!)
@Lonsdale201
Lonsdale201 / szechenyicode
Created May 26, 2024 21:10
Széchenyi logo + Toggle funkció
// másold be a kódot egy snippet tárolására alkalmas bővítménybe.
// FluentSnippets esetében válaszd a Content (php + html) opciót és a teljes kódot másold be , hogy hol fusson "Where to run" válaszd a "Site Wide Footer" opciót
// cseréld ki a képet, a saját weboldaladra feltöltött médiatáras kép linkjével
// ezt cseréld ki a kódban: "<img id="fixedImage" src="http://sajatweboldalam.hu/wp-content/uploads/2024/05/infoblokk-jobb-also-sarokban.png" alt="Szechenyi logo">"
// a kód alsó részében (script részben) van egy átirányítási opció ha a képre kattintanak, kommenteld ki, vagy töröld ha nincs rá szükséged.
// localstorage ba tárolja a kód, ha el van rejtve, vagy nincs a logó, így nem nyitja ki minden oldal újratöltődéskor.
<div id="imageContainer">
<button id="toggleButton">
<svg id="chevronIcon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-up">
@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.
@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