This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Adds a meta box to the post editing screen for changing the post's publication | |
// date and time after it has initially been published. | |
// Only visible to administrators. | |
// Place in functions.php file. | |
function cdap_add_meta_box() { | |
// Check if the current user is an administrator | |
if (current_user_can('administrator')) { | |
add_meta_box( | |
'cdap_meta_box', // ID of the meta box |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// VALUE UNIT STRIPPING AND CONVERSION FUNCTION TOOLS | |
// By Nicolas Giethlen (aka Chmood) | |
// VARIABLES | |
$browser-fontsize-base: 16 !default; // Default browser font-size in px (unitless) | |
$pixels-per-rem: 10 !default; // Root font-size in px (unitless) | |
// FUNCTIONS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Limit How Many Checkboxes Can Be Checked | |
* http://gravitywiz.com/2012/06/11/limiting-how-many-checkboxes-can-be-checked/ | |
*/ | |
class GFLimitCheckboxes { | |
public static $field_limits; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// standard usage | |
new GFLimitCheckboxes(115, array( | |
5 => array( | |
'min' => 2, | |
'max' => 3 | |
) | |
)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* WARNING! THIS SNIPPET MAY BE OUTDATED. | |
* The latest version of this snippet can be found in the Gravity Wiz Snippet Library: | |
* https://github.com/gravitywiz/snippet-library/blob/master/gravity-forms/gw-submission-limit.php | |
*/ | |
/** | |
* Gravity Wiz // Gravity Forms // Limit Submissions Per Time Period (by IP, User, Role, Form URL, or Field Value) | |
* | |
* Limit the number of times a form can be submitted per a specific time period. You modify this limit to apply to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Disable auto-complete on form. | |
add_filter( 'gform_form_tag', function( $form_tag ) { | |
return str_replace( '>', ' autocomplete="off">', $form_tag ); | |
}, 11 ); | |
// Diable auto-complete on each field. | |
add_filter( 'gform_field_content', function( $input ) { | |
return preg_replace( '/<(input|textarea)/', '<${1} autocomplete="off" ', $input ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Gravity Wiz // Gravity Forms // Set Input Type as Tel | |
* http://gravitywiz.com/ | |
*/ | |
add_filter( 'gform_field_content_723_10', 'gw_set_tel_input_type' ); | |
function gw_set_tel_input_type( $input ) { | |
$input = preg_replace( "/type='[\\w]+'/", "type='tel'", $input ); | |
return $input; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Gravity Wiz // Gravity Forms // Give First Validation Error Focus | |
* http://gravitywiz.com/ | |
* | |
* Plugin Name: Gravity Forms First Error Focus | |
* Plugin URI: https://gravitywiz.com/make-gravity-forms-validation-errors-mobile-friendlyer/ | |
* Description: Automatically focus (and scroll) to the first field with a validation error. | |
* Author: Gravity Wiz | |
* Version: 1.1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Plugin Name: Gravity Forms: Move Progress Bar to Bottom of Form | |
* Plugin URI: http://www.n7studios.co.uk | |
* Version: 1.0.1 | |
* Author: n7 Studios | |
* Author URI: http://www.n7studios.co.uk | |
* Description: Moves the progress bar from the top to the bottom of the Gravity Form. The Start Paging section of the form MUST have a CSS class = progress-bar-bottom | |
*/ | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Gravity Perks // Populate Anything // Range Modifier for Live Merge Tags | |
* https://gravitywiz.com/documentation/gravity-forms-populate-anything/ | |
* | |
* Use the :range modifier with checkbox merge tags to get the range of checked options | |
* Works well with the :value modifier | |
* | |
* Will return `x - y` where the min and max are different, or `x` if they are the same |
NewerOlder