Skip to content

Instantly share code, notes, and snippets.

View ElmsPark's full-sized avatar

ElmsPark ElmsPark

  • ElmsPark Consultants
  • Dublin
  • 02:43 (UTC +01:00)
View GitHub Profile
@ElmsPark
ElmsPark / Limit Gravity Forms Upload Size
Created January 16, 2022 14:12 — forked from mandiwise/Limit Gravity Forms Upload Size
Set a maximum upload size for a Gravity Forms image field
function limit_file_upload_size( $validation_result ) {
$form = $validation_result['form'];
foreach( $form['fields'] as &$field ){
// NOTE: Add a custom CSS class to your image upload field and grab onto it here...
if( strpos( $field['cssClass'], 'choose-file' ) === false )
continue;
@ElmsPark
ElmsPark / ar-quick-look.php
Created January 15, 2022 22:42 — forked from alpipego/ar-quick-look.php
Upload USDZ/Reality files for AR Quick Look to WordPress
<?php
/**
* Plugin Name: Upload AR Quick Look files
* Description: Upload AR Quick Look files (usdz or reality) to your WordPress media library.
* Author: Alexander Goller
* Author URI: https://alexandergoller.com
*/
$arMimes = [
@ElmsPark
ElmsPark / kinsta-share-users.php
Created March 17, 2021 19:28 — forked from carlodaniele/kinsta-share-users.php
A plugin to share users and usermeta tables between independent WordPress installations. This plugin requires CUSTOM_USER_TABLE and CUSTOM_USER_META_TABLE defined into wp-config file
<?php
/**
* @package Kinsta_Share_Users
* @version 1.0
*/
/*
Plugin Name: Kinsta Share Users
Plugin URI: http://wordpress.org/extend/plugins/#
Description: This is an example plugin for Kinsta blog readers
Author: Carlo Daniele
@ElmsPark
ElmsPark / ipn.php
Created June 25, 2020 10:39
PayPal Multiple IPN
<?php
ini_set( 'max_execution_time', 0 ); /* Do not abort with timeouts */
ini_set( 'display_errors', 'Off' ); /* Do not display any errors to anyone */
$urls = array(); /* The broadcast session queue */
/* List of IPN listener points */
$ipns = array(
'edd' => 'https://domain.com/?edd-listener=IPN',
'edd_payments' => 'https://domain.com/?Paypal_For_Edd=&action=ipn_handler',
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>Activate</key>
<string>Normal</string>
<key>CreationDate</key>
<real>604609311.14479399</real>
<key>Macros</key>
@jtsternberg
jtsternberg / fix-badgos-select2-for-gathercontent.php
Created February 27, 2017 15:46
Fix problem with badgeos old select2 version when using gathercontent
<?php
/**
* If badgeos select2 is enqueued, remove it, as it causes conflicts.
*/
function fix_badgeos_bug_for_gathercontent( $data ) {
// BadgeOS is a bad citizen as it is enqueueing its (old) version of select2 in the entire admin.
// It is incompatible with the new version, so we need to remove it on our pages.
if ( wp_script_is( 'badgeos-select2', 'enqueued' ) ) {
wp_dequeue_script( 'badgeos-select2' );
@mrkdevelopment
mrkdevelopment / In your social icons file
Last active July 15, 2024 01:05
Divi social icons extension
<?php if ( 'on' === et_get_option( 'divi_show_linkedin_icon', 'on' ) ) : ?>
<li class="et-social-icon et-social-linkedin">
<a href="<?php echo esc_url( et_get_option( 'divi_linkedin_url', '#' ) ); ?>" class="icon">
<span><?php esc_html_e( 'Linked In', 'Divi' ); ?></span>
</a>
</li>
<?php endif; ?>
<?php if ( 'on' === et_get_option( 'divi_show_youtube_icon', 'on' ) ) : ?>
<li class="et-social-icon et-social-youtube">
@krugazul
krugazul / class-woothemes-sensei-certificates.php
Last active May 3, 2017 02:57
Additional filters for Woothemes Sensei Certificates to allow custom fields to be included on your PDF.
<?php
/*
* NB You will need to add the following lines into the actual plugin.
* line 114,122,130,138 and 146 - are the filters which you want to include in you sensei-certificates plugin.
* line 158 - this filter allows you to change the type of field, textarea or normal input.
*/
class WooThemes_Sensei_Certificates {
@woogist
woogist / functions.php
Last active July 15, 2024 08:39
The code below adds Sensei support to your Divi Theme. To use it simply copy it to your Divi functions.php file.
/**
* Declare Sensei support
*
* This is needed to hide the Sensei theme compatibility notice your admin dashboard.
*/
add_action( 'after_setup_theme', 'divi_sensei_support' );
function divi_sensei_support() {
add_theme_support( 'sensei' );
}
@thewebprincess
thewebprincess / dateform.js
Last active May 15, 2023 19:33
Gravity Forms - Datepicker extension for Date Range Fields
jQuery(function ($) {
var datepickerInArgs = {
minDate: 1,
defaultDate: 0,
dateFormat: 'dd/mm/yy',
changeMonth: true,
changeYear: true,
onClose: function( dateText, inst ) {
var d = $.datepicker.parseDate( inst.settings.dateFormat, dateText );