Skip to content

Instantly share code, notes, and snippets.

View patrickfreitasdev's full-sized avatar

Patrick de Freitas patrickfreitasdev

View GitHub Profile
<?php
/**
* Upload a CSV file named limit.csv inside the mu-plugin folder,
* it must have only one column for the IDs that you would like to limit
*/
add_filter('forminator_custom_form_submit_errors', 'my_custom_form_validation', 10, 3);
function my_custom_form_validation($submit_errors, $form_id, $field_data_array) {
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( defined( 'WP_CLI' ) && WP_CLI ) {
return;
}
<?php
add_action( 'wp_footer', function(){ ?>
<script>
(function ($) {
$(function () {
$(document).on("after.load.forminator", function (e, id) {
var cvalinput = $('.custom-validate input');
let regx = /^[0-9]*$/;
<?php
/**
* Plugin Name: [Smush] - Add smush_dir_images to DB
* Plugin URI: https://premium.wpmudev.org/
* Description: Add Smush Missing Table to DB to fix the message taht says: Directory smushing requires custom tables and it seems there was an error creating tables. For help, please contact our team on the support forums.
* Task: SLS-1383
* Author: Youssef Mhamdi @ WPMUDEV
* Author URI: https://premium.wpmudev.org/forums/profile/mhamdiyoussef/
* License: GPLv2 or later
*/
<?php
add_action( 'wp_footer', function(){ ?>
<script>
(function ($) {
$(function () {
$(document).on("after.load.forminator", function (e, id) {
var cvalinput = $('.custom-uppercase input');
$(cvalinput).bind('focusout keyup ', function () {
<?php
add_action( 'wp_footer', function(){ ?>
<script>
(function ($) {
$(function () {
var cvalinput = $('.custom-uppercase input');
$(cvalinput).bind('focusout keyup ', function () {
<?php
add_action( 'wp_footer', function(){ ?>
<script>
(function ($) {
$(function () {
$(document).on("after.load.forminator", function (e, id) {
$("#calculation-1-field").prop("disabled", false);
});
<?php
if ( ! defined( 'ABSPATH' ) ) {
die();
}
// No need to do anything if the request is via WP-CLI.
if ( defined( 'WP_CLI' ) && WP_CLI ) {
return;
}
window.onload = function() {
jQuery(document).ready(function($){
// Load only on Home Page
if ( jQuery('body').hasClass('home')) {
// Get the iFrame
let myiFrame = document.getElementById("mfs_html5");
<?php
//shortcodes to use [updated-at] & [posted-at]
//Using this to protect the plugin
defined('ABSPATH') or die('What are you looking for?');
function post_updated_custom_shortcode_WPMUDEV(){
ob_start();
$updated_at = ( get_the_modified_time( 'U' ) > get_the_time( 'U' ) ) ? get_post_modified_time('F j, Y, g:i a') : get_the_date('F j, Y, g:i a');