Skip to content

Instantly share code, notes, and snippets.

View patrickfreitasdev's full-sized avatar

Patrick de Freitas patrickfreitasdev

View GitHub Profile
<?php
add_action( 'wp_footer', function(){
?>
<script>
jQuery( document ).ready(function($) {
{"type":"form","data":{"fields":[{"id":"select-1","element_id":"select-1","form_id":"wrapper-9472-6686","type":"select","options":[{"label":"Residential","value":"Residential","limit":"","key":"9054-8303","calculation":"60"},{"label":"Commercial","value":"Commercial","limit":"","key":"7320-4535","calculation":"50"}],"cols":"3","conditions":[],"wrapper_id":"wrapper-9472-6686","value_type":"single","field_label":"Project Type","options_bulk_editor":"Residential ; Residential; 0 Commercial; Commercial; 0","options_expanded":"","calculations":"true","required":"1","placeholder":"Select","required_message":"Required Field"},{"id":"number-1","element_id":"number-1","form_id":"wrapper-9472-6686","type":"number","options":[],"cols":"3","conditions":[{"element_id":"select-1","rule":"is","value":"Residential"}],"wrapper_id":"wrapper-9472-6686","calculations":"false","limit_min":"1","limit_max":"10","field_label":"Number of Rooms","placeholder":"E.g. 10","required":"1","separators":"blank","required_message":"Required F
<?php
// References:
// https://developer.wordpress.org/reference/functions/get_comment/
// https://developer.wordpress.org/reference/hooks/comment_form_default_fields/
// https://developer.wordpress.org/reference/hooks/comment_post/
// https://help.groundhogg.io/article/201-adding-a-tag-on-an-action
// Create new Checkbox
function mailist_comment_form_custom( $fields ) {
<?php
/**
* Plugin Name: [Forminator] - Add class name for button pagination.
* Description: [Forminator] - Add class name for button pagination.
* Jira: browse//SLS-930
* Author: Thobk @ WPMUDEV
* Author URI: https://premium.wpmudev.org
* License: GPLv2 or later
*/
<?php
add_action( 'wp_footer', function(){ ?>
<script>
(function ($) {
$(function () {
$(document).on("after.load.forminator", function (e, id) {
var email_1 = $('.validate-email-1 input');
var email_2 = $('.validate-email-2 input');
<?php
add_filter( 'forminator_custom_form_submit_errors', function( $submit_errors, $form_id, $field_data_array ) {
// Add your form IDs here.
$form_ids = array( 842 );
// Change this to the message that you want to show.
$message = 'You cannot submit more than 5 times within 30 days.';
if ( in_array( intval( $form_id ), $form_ids, true ) ) {
$user_ip = Forminator_Geo::get_user_ip();
<?php
add_action(
'wp_footer',
function() {
if ( ! wp_script_is( 'forminator-front-scripts' ) ) {
return;
}
?>
<?php
// Check price when adding to cart
add_action( 'woocommerce_add_to_cart', function ()
{
$total = WC()->cart->cart_contents_total;
$total_trigger = 100;
$hustle_module = 'PopUp'; // SlideIn, PopUp
$module_id = 13;
<?php
add_action('wp_footer','custom_js_form_validation');
function custom_js_form_validation(){
?>
<script>
jQuery( document ).ready(function($) {
<?php
/**
* Plugin Name: [Forminator Pro] - Allow style in e-mail - SLS-3357
* Plugin URI: https://premium.wpmudev.org/
* Description: Allow an e-mail template with style
* Author: Prashant Singh @ WPMUDEV
* Author URI: https://premium.wpmudev.org/
* License: GPLv2 or later
*/