Skip to content

Instantly share code, notes, and snippets.

@phillipwilhelm
phillipwilhelm / .htaccess
Created March 28, 2020 06:04 — forked from hofmannsven/.htaccess
Custom WordPress Setup
# Block access to WordPress specific files
<files .htaccess>
Order allow,deny
Deny from all
</files>
<files readme.html>
Order allow,deny
Deny from all
</files>
<files readme.txt>
@phillipwilhelm
phillipwilhelm / README.md
Created March 28, 2020 06:03 — forked from hofmannsven/README.md
Notes on working with Tableau Server APIs
<?php
/**
* Gravity Perks // eCommerce Fields // Consolidate Separate Discount Line Items into a Single Discounts Line Item
* http://gravitywiz.com/documentation/gravity-forms-ecommerce-fields/
*
* Default: https://gwiz.io/2IiPALf
* w/ Snippet: https://gwiz.io/2Itfyfo
*/
// Update "123" to your form ID - or - remove "_123" to apply to all forms.
add_filter( 'gpecf_order_summary_123', function( $summary ) {
<?php
/**
* Gravity Perks // Populate Anything // Use Standard Merge Tags in Choice/Value Templates
* http://gravitywiz.com/documentation/gravity-forms-populate-anything/
*/
add_filter( 'gppa_process_template', function( $template_value, $field, $template, $populate, $object, $object_type, $objects ) {
return GFCommon::replace_variables( $template_value, GFAPI::get_form( $object->form_id ), (array) $object );
}, 10, 7 );
@phillipwilhelm
phillipwilhelm / gw-gravity-forms-shortcodes-as-merge-tags.php
Created March 28, 2020 05:45 — forked from spivurno/gw-gravity-forms-shortcodes-as-merge-tags.php
Gravity Wiz // Gravity Forms // Shortcodes as Merge Tags for Gravity Forms Conditional Shortcode
<?php
/**
* Gravity Wiz // Gravity Forms // Shortcodes as Merge Tags for Gravity Forms Conditional Shortcode
* http://gravitywiz.com/
*
* Requires Gravity Forms 2.4.17.2+
*
* Usage:
*
* 1. First convert your shortcode into a merge tag.
<?php
add_filter( 'gpecf_order_sumary_markup', 'get_custom_order_summary_markup', 10, 6 );
function get_custom_order_summary_markup( $markup, $order, $form, $entry, $order_summary, $labels ) {
ob_start();
?>
<table class="gpecf-order-summary" cellspacing="0" width="100%" style="<?php gp_ecommerce_fields()->style( '.order-summary' ); ?>">
<thead>
<tr>
<th scope="col" style="<?php gp_ecommerce_fields()->style( '.order-summary/thead/th.column-1' ); ?>"><?php echo $labels['product']; ?></th>
@phillipwilhelm
phillipwilhelm / get-radius.php
Created March 28, 2020 05:29 — forked from zackkatz/get-radius.php
Get a lat/long radius from passed latitude and longitude
<?php
/**
* Calculate the longitude and latitude or a radius around a location
*
* Returns an array with the following keys: `LatitudeMax`, `LongitudeMax`, `LatitudeMin`, `LongitudeMin`, to produce a radius search
*
* @param string|float $longitude The longitude to calculate from
* @param string|float $latitude The latitude to calculate from
* @param integer $miles Number of miles for the radius
@phillipwilhelm
phillipwilhelm / maps-coordinates.php
Created March 28, 2020 05:28 — forked from zackkatz/maps-coordinates.php
Use the cordinates (Latitude and Longitude) instead of the address to position the markers over the Maps
<?php
/**
* Use the coordinates (Latitude, Longitude) instead of the address to position the markers over the Maps
*
* Replace 'MY_LATITUDE_FIELD_ID', 'MY_LONGITUDE_FIELD_ID' with field ids containing the latitude and longitude values
*
* @param array $fields_array Gravity Forms fields IDs containing the latitude and longitude
* @param GravityView_View $gravityview_view Current View object
*
* @return array Array with field IDs of latitude and longitude fields (Example: [ 5, 6 ] ). Empty array if not the form we want to override.
@phillipwilhelm
phillipwilhelm / gravityview-map-coordinates-filled-in.php
Created March 28, 2020 05:27 — forked from zackkatz/gravityview-map-coordinates-filled-in.php
GravityView Maps - Using coordinates example, with values filled-in
<?php
/**
* Use the coordinates (Latitude and Longitude) instead of the address to position the markers on the maps
*
* @see https://docs.gravityview.co/article/300-how-can-i-use-the-latitude-and-longitude-form-fields-to-position-map-markers
*
* @param array $fields_array Gravity Forms fields IDs containing the latitude and longitude
* @param GravityView_View $gravityview_view Current View object
*
* @return array Array with field IDs of latitude and longitude fields (Example: [ 5, 6 ] ). Empty array if not the form we want to override.