Skip to content

Instantly share code, notes, and snippets.

View alfredo-wpmudev's full-sized avatar
🏠
Working from home

Alfredo Galano Loyola alfredo-wpmudev

🏠
Working from home
View GitHub Profile
<?php
/* Inline script printed out in the footer */
add_action('wp_footer', 'forminator_conditional_calculation_script_wp_footer');
function forminator_conditional_calculation_script_wp_footer() {
?>
<script>
//Demo -> https://cuban.tempurl.host/forminator-if-conditional/
//Checking if the forminator form [forminator_form id="1046668"] exist on the page
if(jQuery("#forminator-module-1046668")){
/* In this example the calculation is {hidden-1}*{number-1}*{number-2} */
<?php
//Working in progress
$arguments =[
'formID' => 1046668,
'variableValue' => '{hidden-1}',
'fixedValue' => 25,
'showField' => '{text-2}',
'triggerField' => '{text-1},{text-3}',
'logic' => 'if({text-1}>=5 && {text-1}<=9){{hidden-1}=fixedValue*0.9}else if({text-1}>=10 && {text-1}<=16){{hidden-1}=fixedValue*0.8}else{{hidden-1}=fixedValue}'
];
<?php
add_action('wp_footer','custom_js_form_validation');
function custom_js_form_validation(){
?>
<script>
jQuery( document ).ready(function($) {
@alfredo-wpmudev
alfredo-wpmudev / forminator-populate-usermeta.php
Created September 28, 2022 23:40 — forked from wpmudev-sls/forminator-populate-usermeta.php
[Forminator] - Auto populate fields with usermeta.
<?php
/**
* Plugin Name: [Forminator] - Auto populate fields with usermeta.
* Plugin URI: https://premium.wpmudev.org/
* Description: Autopopulate Forminator fields with usermeta.
* Author: Panos Lyrakis, Prashant Singh @ WPMUDEV
* Author URI: https://premium.wpmudev.org/
* License: GPLv2 or later
*/
@alfredo-wpmudev
alfredo-wpmudev / lazy_load_youtube_video.php
Last active September 24, 2023 21:26
WordPress Lazy Load Youtube Videos
<?php
/*
Plugin Name: Lazy Youtube Video
Version: 1.5
Description: Lazy Load videos from Youtube on WordPress.
Author: Alfredo Galano Loyola
Author URI: https://nomcomaspin.ga/
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: lazy-youtube-video
<?php
/**
* Plugin Name: [Forminator] Time Date Picker Minute Default Value
* Plugin URI: https://premium.wpmudev.org
* Description: With this snippet is possible set all Forminator Time Date Picker Minute field to a default value, 00
* Author: Alfredo Galano Loyola @ WPMUDEV
* Author URI: https://premium.wpmudev.org
* License: GPLv2 or later
*/
add_action( 'wp_footer', 'setForminatorDefaultMinutes' );
<?php
/**
* Plugin Name: [Forminator] Using ACF Fields as Categories and Tags
* Plugin URI: https://wpmudev.com/
* Description: Allow Forminator create a post and use the values on ACF fields for Categories and Tags.Categories and Tags will be created if does'nt exist.
* Author: Alfredo Galano Loyola @ WPMUDEV
* Author URI: https://wpmudev.com/
* License: GPLv2 or later
*
* @package Forminator_ACF_Fields_Categories_and_Tags
<?php
/**
* Plugin Name: [Forminator Pro] - Bulk add options to a Select field
* Plugin URI: https://premium.wpmudev.org/
* Description: Load data from specific table on the Database and populating the select field.
* Author: Alessandro Kaounas @ WPMUDEV, Paweł Pela @ WPMUDEV, Alfredo Loyola @WPMUDEV
* Author URI: https://premium.wpmudev.org/
* License: GPLv2 or later
*/
<?php
add_filter('forminator_custom_form_mail_admin_headers', 'wpmudev_change_forminator_header_attachment', 10, 5);
function wpmudev_change_forminator_header_attachment($headers, $custom_form, $data, $entry, $cls)
{
$form_list = array(1048104, 1045, 1050);//Please put here the formIDs
if (!in_array($custom_form->id, $form_list)) {
return $headers;
}
<?php
/**
* Plugin Name: [Forminator Pro] - Bulk add options to a Select field Church Groups
* Plugin URI: https://premium.wpmudev.org/
* Description: Load data from specific table on the Database and populating the select field.
* Author: Alessandro Kaounas @ WPMUDEV, Paweł Pela @ WPMUDEV, Alfredo Loyola @WPMUDEV
* Author URI: https://premium.wpmudev.org/
* License: GPLv2 or later
*/