Skip to content

Instantly share code, notes, and snippets.

Avatar

Ross McKay webaware

View GitHub Profile
@webaware
webaware / gf-country-usa.php
Created Jul 1, 2020
change United States to USA in Gravity Forms addresses, with support for Gravity Forms Address Enhanced
View gf-country-usa.php
<?php
/*
Plugin Name: GF Country USA
Plugin URI: https://gist.github.com/webaware/edba921af11f06bdfd5147bab806f591
Description: change United States to USA in Gravity Forms addresses
Version: 1
Author: WebAware
Author URI: https://shop.webaware.com.au/
*/
@webaware
webaware / mininum_age_woo_checkout_hook.php
Created Jun 6, 2020
change position of the Minimim Age question on WooCommerce checkout, for the plugin Minimum Age for WooCommerce https://wordpress.org/plugins/minimum-age-woocommerce/
View mininum_age_woo_checkout_hook.php
/**
* change position of Minimim Age question on WooCommerce checkout
* @param string $hook_name
* @return string
*/
add_filter('mininum_age_woo_checkout_hook', function($hook_name) {
return 'woocommerce_checkout_order_review';
});
@webaware
webaware / gf-country-as-code.php
Last active May 29, 2020
Save the country subfield of a Gravity Forms address as the country code.
View gf-country-as-code.php
<?php
/*
Plugin Name: GF Country as Code
Plugin URI: https://gist.github.com/webaware/c5b624416ad4a5641daab54ba9c91a0a
Description: save the country subfield of an address as the country code
Version: 1
Author: WebAware
Author URI: https://shop.webaware.com.au/
*/
@webaware
webaware / Gruntfile.js
Created Jul 5, 2019
Our favicon / site tile cheat sheet for WordPress themes
View Gruntfile.js
// add task to Gruntfile.js
shell: {
// @link https://github.com/sindresorhus/grunt-shell
favicon: {
options: {
execOptions: {
cwd: "./images/favicons"
}
},
command: [
@webaware
webaware / edd-additional-api-info.php
Last active Dec 31, 2018
Supply some additional info in the EDD Software Licensing API update info packet, specifically: Requires WordPress Version, Compatible up to, Requires PHP Version
View edd-additional-api-info.php
<?php
/*
Plugin Name: EDD Additional API Info
Plugin URI: https://gist.github.com/webaware/ccc2a77a8375da9ff02404b1fc033d05
Description: supply additional info in the EDD Software Licensing API update info packet
Version: 1
Author: WebAware
Author URI: https://shop.webaware.com.au/
*/
@webaware
webaware / code-excerpt.php
Created Dec 31, 2018
code excerpt for restoring the FAQ section to responses in EDD Software Licensing API calls
View code-excerpt.php
<?php
//...
add_filter('edd_sl_license_readme_response', array($this, 'eddMaybeRestoreFAQ'), 10, 3);
/**
* maybe restore the FAQ section to the update info package
* @param array $response
@webaware
webaware / em-extra-fee.php
Created Jul 12, 2018
Add an extra fee for eWAY transactions in Events Manager
View em-extra-fee.php
<?php
/*
Plugin Name: Events Manager eWAY Extra Fee
Plugin URI: https://gist.github.com/webaware/ea1261d9aae60f86bb7d8b7ea7fea589
Description: Add a fee to booking for eWAY transactions
Version: 1
Author: WebAware
Author URI: https://shop.webaware.com.au/
*/
@webaware
webaware / gf-paypal-billing-page.php
Last active Mar 23, 2018
Get Gravity Forms to select a better landing page with PayPal Standard, and make your credit card customers happier. https://snippets.webaware.com.au/snippets/select-paypal-landing-page-for-easy-digital-downloads/
View gf-paypal-billing-page.php
<?php
/*
Plugin Name: GF PayPal Standard billing Page
Plugin URI: https://gist.github.com/webaware/a3172f7f81ff56cd844d7adca92726a6
Description: Get Gravity Forms to select a better landing page with PayPal Standard, and make your credit card customers happier.
Version: 1
Author: WebAware
Author URI: https://shop.webaware.com.au/
*/
@webaware
webaware / edd-paypal-billing-page.php
Last active Feb 19, 2018
Get Easy Digital Downloads to select a better landing page with PayPal Standard, and make your credit card customers happier. https://snippets.webaware.com.au/snippets/select-paypal-landing-page-for-easy-digital-downloads/
View edd-paypal-billing-page.php
<?php
/*
Plugin Name: EDD PayPal Standard billing page
Plugin URI: https://gist.github.com/webaware/8751f3e4923ef5e24b322c89e04d385a
Description: Get Easy Digital Downloads to select a better landing page with PayPal Standard, and make your credit card customers happier.
Version: 1
Author: WebAware
Author URI: https://shop.webaware.com.au/
*/
@webaware
webaware / plugin-template-functions.php
Created Feb 17, 2018
I have these functions in the plugin class that accesses templates, or break them out into simple functions if I'm using a namespace
View plugin-template-functions.php
<?php
/**
* load template from theme or plugin
* @param string $template name of template to load
* @param array $templateData data to make available to templates
*/
public function loadTemplate($template, $templateData = []) {
extract($templateData);
You can’t perform that action at this time.