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
<?php | |
/** | |
* Function: convert_number | |
* | |
* Description: | |
* Converts a given integer (in range [0..1T-1], inclusive) into | |
* alphabetical format ("one", "two", etc.) | |
* | |
* @int | |
* |
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
<?php | |
/* | |
* This snippet is assuming the user already logged in or the provided email address is available in users | |
* After the form submission the user will be added to the course. | |
*/ | |
add_action( 'fluentform_submission_inserted', 'ff_register_user_to_learndash_course', 100, 3 ); | |
function ff_register_user_to_learndash_course( $entryId, $formData, $form ) { | |
// Check if the form is the one we want |
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
<?php | |
/* | |
* Code snippet to expose ninja tables data as JSON via URL | |
* Example URL: https://yourdomain.com/?get_ninja_table_data=1463&key=your_security_key | |
* In this url 1463 is the table ID that you want to access the data using JSON | |
* You should change the key 'your_security_key' in the url as well in the code | |
* to protect the endpoint | |
*/ | |
add_action('init', function() { |
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
(function($){ | |
if(typeof gtag != 'function') { | |
return; | |
} | |
var fluentForms = $('form.frm-fluent-form'); | |
fluentForms.each(function() { | |
var $form = $(this); | |
var formId = $form.attr('data-form_id'); | |
gtag('event', 'ViewForm', { |
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
<?php | |
/* | |
* Use default value in the editor as | |
* {embed_post_author_email} | |
* Then it will show the embeded post's author email | |
*/ | |
add_filter('fluentform_editor_shortcode_callback_embed_post_author_email', function ($code) { | |
return get_the_author_meta('user_email'); | |
}); |
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
<?php | |
add_filter('fluent_crm_asset_listed_slugs', function ($slugs) { | |
$slugs[] = '\/atarim-visual-collaboration\/'; | |
return $slugs; | |
}); |
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
// required css | |
<style> | |
span.ff_submitting { | |
display: none; | |
} | |
.ff-working span.ff_submitting { | |
display: block; | |
} |
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
<?php | |
function ninjaSanitizeTextOrArray( $array_or_string ) { | |
if ( is_string( $array_or_string ) ) { | |
$array_or_string = sanitize_text_field( $array_or_string ); | |
} elseif ( is_array( $array_or_string ) ) { | |
foreach ( $array_or_string as $key => &$value ) { | |
if ( is_array( $value ) ) { | |
$value = ninjaSanitizeTextOrArray( $value ); | |
} else { |
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
<?php | |
/* | |
* Catch submission the before it's inserting in database | |
* if you want to log the data in the database use hook: fluenform_before_submission_confirmation | |
*/ | |
add_action('fluentform_before_insert_submission', function ($insertData, $data, $form) { | |
if($form->id != 156) { // 156 is our target form id | |
return; | |
} |