Skip to content

Instantly share code, notes, and snippets.

View endurtech's full-sized avatar

Manny Rodrigues endurtech

View GitHub Profile
<?php
// update the number '1' to the ID number on your form
// https://endurtech.com/create-read-only-field-in-gravityforms/
add_filter( 'gform_pre_render_1', 'add_readonly_script' );
function add_readonly_script( $form )
{
?><script type="text/javascript">jQuery(document).ready(function() { jQuery("li.gf_readonly input[type=checkbox]").attr("onclick","return false;"); });</script><?php
return $form;
}
?>
<?php
// update the number '1' to the ID number on your form
// https://endurtech.com/create-read-only-field-in-gravityforms/
add_filter( 'gform_pre_render_1', 'add_readonly_script' );
function add_readonly_script( $form )
{
?><script type="text/javascript">jQuery(document).ready(function() { jQuery("li.gf_readonly input").attr("readonly","readonly"); });</script><?php
return $form;
}
?>
<?php
// update the number '1' to the ID number on your form
// https://endurtech.com/create-read-only-field-in-gravityforms/
add_filter( 'gform_pre_render_1', 'add_readonly_script' );
function add_readonly_script( $form )
{
?><script type="text/javascript">jQuery(document).ready(function() { jQuery("li.gf_readonly textarea").attr("readonly","readonly"); });</script><?php
return $form;
}
?>
@endurtech
endurtech / disable-wordpress-admin-email-verification-prompt.php
Created June 15, 2020 10:48
Disables the WordPress Administration email verification prompt completely when inserted into your Child Theme's functions.php flie.
<?php
// Disable WordPress Administration email verification prompt
add_filter( 'admin_email_check_interval', '__return_false' );
?>
@endurtech
endurtech / function-set-avia-frontend.php
Created December 17, 2019 14:02
Patch to fix missing Social Media Icon Fonts in Enfold theme after updating to WordPress 5.3.1. Read more at: https://endurtech.com/social-media-icons-missing-in-enfold-theme/
<?php
/**
* This file holds various helper functions that are needed by the frameworks FRONTEND
*
* @author Christian "Kriesi" Budschedl
* @copyright Copyright (c) Christian Budschedl
* @link http://kriesi.at
* @link http://aviathemes.com
* @since Version 1.0
* @package AviaFramework
@endurtech
endurtech / gform-disallowed-file-extensions-exclusions.php
Last active September 20, 2019 18:58
To get around the Gravity Forms File Upload Extension Exclusion List use the following snippet in your theme's functions.php file or a custom functions plugin.
<?php
/*
** GravityForms Disable File Extension Renaming Security Feature
** Simply add your extensions into the allowed_extensions array.
** Example: $allowed_extensions = array( 'html', 'htm' ); //for all html and htm extensions
** Special thanks to Karl Potter, Gravity Forms Support Specialist
** https://endurtech.com/gravity-forms-renaming-uploaded-files-breaking-links/
*/
<?php
/*
** Disables the user email when a user changes their email address
** Simply insert into your theme functions.php
** https://endurtech.com/disable-wordpress-user-notification-email-when-user-email-changed/
*/
function xuser_email_upon_email_change()
{
<?php
/*
** Disables the user email when a user resets their password.
** Simply insert into your theme functions.php
** https://endurtech.com/disable-wordpress-user-notification-email-when-user-password-changed/
*/
add_filter( 'send_password_change_email', '__return_false' );
<?php
/*
** Disables the admin email when a user resets their password.
** Must be in plugin, won't work in theme functions.php, because pluggable.php called 1st.
** https://endurtech.com/disable-wordpress-admin-notification-email-when-user-password-changed/
*/
if ( ! function_exists( 'wp_password_change_notification' ) )
{
function wp_password_change_notification( $user )
@endurtech
endurtech / gf-custom-user-registration-activation-page.php
Last active July 22, 2019 19:53
For Gravity Forms User Registration Activation. When a visitor registers an activation email is sent with an activation link. Upon activation send the new subscriber to a specific activation page. Relocate the Gravity Forms activation.php file to your active theme's root directory and insert this code into your themes' functions.php
<?php
/**
* Gravity Forms Custom User Registration Activation Page
* https://endurtech.com/gravity-forms-custom-user-registration-activation-page/
*/
add_action( 'wp', 'custom_activation_page' );
function custom_activation_page()
{
// Set path to activation page. Set to parent/child theme root.