Skip to content

Instantly share code, notes, and snippets.

@phillipwilhelm
phillipwilhelm / woocommerce.css
Created September 4, 2016 22:45 — forked from catchthemes/woocommerce.css
Make the WooCommerce Cart Table Responsive for Mobile Devices
/* START Make the WooCommerce Cart Table Responsive for Mobile */
/* CSS published in http://www.jeremycarter.com.au/optimising-woocommerce-checkout-for-mobile/ */
@media screen and (max-width: 600px) {
/* Force table to not be like tables anymore */
.woocommerce-page table.shop_table,
.woocommerce-page table.shop_table thead,
.woocommerce-page table.shop_table tbody,
.woocommerce-page table.shop_table th,
@phillipwilhelm
phillipwilhelm / gw-gravity-forms-populate-entries.php
Created September 5, 2016 03:31 — forked from spivurno/gw-gravity-forms-populate-entries.php
Gravity Wiz // Gravity Forms Populate With Entries
<?php
/**
* Gravity Wiz // Gravity Forms Populate With Entries
*
* Populate choice-based fields (i.e. drop downs, radios, checkboxes) with data from Gravity Form entries.
*
* @version 1.0
* @author David Smith <david@gravitywiz.com>
* @license GPL-2.0+
* @link http://gravitywiz.com/...
@phillipwilhelm
phillipwilhelm / gw-documentation-multiple-instances-of-class-same-form.php
Created September 5, 2016 04:07 — forked from spivurno/gw-documentation-multiple-instances-of-class-same-form.php
Gravity Wiz // Documentation // FAQ // How do I apply a class-based snippet to different forms?
<?php
new GW_Sample_Class( array(
'form_id' => 1,
'target_field_id' => 7,
'modifier' => '+1 year'
) );
new GW_Sample_Class( array(
'form_id' => 1,
@phillipwilhelm
phillipwilhelm / gw-gravity-forms-save-and-continue-resume-url.php
Created September 5, 2016 04:08 — forked from spivurno/gw-gravity-forms-save-and-continue-resume-url.php
Gravity Wiz // Gravity Forms // Remove query args from Save & Continue's "resume url".
<?php
/**
* Gravity Wiz // Gravity Forms // Remove query args from Save & Continue's "resume url".
*
* If form is access from the url:
*
* http://mysite.com/form-page/?boom=1
*
* Reume URL would be:
*
@phillipwilhelm
phillipwilhelm / gp-unique-id-prepend-date-to-unique-id.php
Created September 5, 2016 04:09 — forked from spivurno/gp-unique-id-prepend-date-to-unique-id.php
Gravity Perks // GP Unique ID // Prepend Date to Unique ID
/**
* Gravity Perks // GP Unique ID // Prepend Date to Unique ID
*/
add_filter( 'gpui_unique_id', 'add_date_to_unique_id', 10, 3 );
function add_date_to_unique_id( $unique, $form_id, $field_id ) {
if( $form_id == 1 && $field_id == 2 ) {
// if $unique was "123", this would change it do something like "01132015_123"
$unique .= date( 'mdy' ) . '_' . $unique;
}
@phillipwilhelm
phillipwilhelm / gw-gravity-forms-post-excerpt-content-template.php
Created September 5, 2016 04:10 — forked from spivurno/gw-gravity-forms-post-excerpt-content-template.php
Gravity Wiz // Gravity Forms // Content Template for Post Excerpt Field
<?php
/**
* Gravity Wiz // Gravity Forms // Content Template for Post Excerpt Field
*
* Gravity Forms does not currently offer a "Content Template" option for the
* Exceprt field. This is a simple snippet that allows you to create
*/
// update "433" to the ID of your form
add_filter( 'gform_post_data_433', 'gw_post_excerpt_content_template_433', 10, 3 );
function gw_post_excerpt_content_template_433( $post_data, $form, $entry ) {
@phillipwilhelm
phillipwilhelm / gw-gravity-forms-submit-to-access.php
Created September 5, 2016 04:10 — forked from spivurno/gw-gravity-forms-submit-to-access.php
Gravity Wiz // Gravity Forms // Submit to Access
<?php
/**
* Gravity Wiz // Gravity Forms // Submit to Access
*
* Require that a form be submitted before a post or page can be accessed.
*
* @version 1.1
* @author David Smith <david@gravitywiz.com>
* @license GPL-2.0+
* @link http://gravitywiz.com/submit-a-gravity-form-to-access-content/
@phillipwilhelm
phillipwilhelm / gw-gravity-forms-form-export.json
Created September 5, 2016 04:10 — forked from spivurno/gw-gravity-forms-form-export.json
Gravity Wiz // Gravity Forms // JSON vs XML Export Format
{
"0": {
"title": "A Simple Form",
"description": "How much simpler is the form export format in Gravity Forms 1.9?",
"labelPlacement": "top_label",
"descriptionPlacement": "below",
"button": {
"type": "text",
"text": "Submit",
"imageUrl": ""
@phillipwilhelm
phillipwilhelm / gp-multi-page-form-navigation-hooks.php
Created September 5, 2016 04:11 — forked from spivurno/gp-multi-page-form-navigation.css
Gravity Perks // Gravity Forms Multi-page Form Navigation // Style Guide
<?php
add_filter( 'gpmpn_frontend_labels', 'modify_gpmpn_frontend_labels', 10, 2 );
add_filter( 'gpmpn_frontend_labels', 'modify_gpmpn_frontend_labels', 10, 2 );
function modify_gpmpn_frontend_labels( $labels, $form ) {
$labels['backToLastPage'] = 'My Custom Button Label';
return $labels;
}
@phillipwilhelm
phillipwilhelm / gp-unique-id-populate-on-pre-submission.php
Created September 5, 2016 04:11 — forked from spivurno/gp-unique-id-populate-on-pre-submission.php
Gravity Perks // GP Unique ID // Populate Unique ID on Pre Submission (rather than Post Entry Creation)
/**
* Gravity Perks // GP Unique ID // Populate Unique ID on Pre Submission (rather than Post Entry Creation)
*
* This method is slightly less reliable for guaranteeing a truly unique ID; however, in some cases, you may want access to the
* unique ID prior to the entry creation.
*/
add_action( 'gform_pre_submission', function( $form ) {
if( ! function_exists( 'gp_unique_id' ) ) {
return;