Skip to content

Instantly share code, notes, and snippets.

View jonwaldstein's full-sized avatar

Jon Waldstein jonwaldstein

View GitHub Profile
@DevinWalker
DevinWalker / give-fee-recovery-import-enhancement.php
Created May 21, 2024 21:23
GiveWP Import Fee Recovery Fields
function my_custom_give_import_donation_fields( $options ) {
// Add 'Donor Age' field
$options['_give_fee_amount'] = [
__( 'Recovered Fee', 'give' ),
__( 'Fee Recovery', 'give' ),
__( 'Fee Recovered', 'give' ),
__( 'Fee Covered', 'give' ),
];
@hereswhatidid
hereswhatidid / acf-gf-dropdown.php
Last active September 10, 2021 00:07
Populate ACF drop down with Gravity Forms forms
<?php
namespace HWID\ACFGravity;
class ACF_GF_DropDown {
public static function init() {
add_filter( 'acf/load_field/key=FIELDKEY', [ 'HWID\ACFGravity\ACF_GF_DropDown', 'populate_gform_dropdown' ] );
@thijskok
thijskok / config.yml
Last active April 4, 2023 05:47
CircleCI 2.0 Laravel build configuration with PHP 7.1, NodeJS, and MySQL support. Runs both PHPunit as well as Laravel Dusk. Proper GD configuration for image editing purposes. Several linters included (requires including them in composer / package.json).
version: 2
jobs:
build:
working_directory: ~/user/repo
environment:
BASH_ENV: ~/.bashrc
docker:
@dustinleblanc
dustinleblanc / .lando.yml
Created March 18, 2018 17:29
Setting up Laravel Dusk with ChromeDriver and Lando
name: cool-app
recipe: laravel
compose:
- docker-compose.yml
config:
php: '7.1'
via: nginx
webroot: public
<?php
/**
* credit: https://github.com/humanmade/hm-core/blob/master/hm-core.functions.php#L1236
* Like get_template_part() put lets you pass args to the template file
* Args are available in the tempalte as $template_args array
* @param string filepart
* @param mixed wp_args style argument list
*/
@schemapress
schemapress / schema-wp-override-description-yoast-seo.php
Last active October 3, 2018 04:50
Override Schema description value with Yoast SEO description https://schema.press
<?php //* do not include php tag
add_filter( 'schema_output', 'schema_wp_override_description_yoast_seo_12345' );
/*
* Override Schema description value with Yoast SEO description
*/
function schema_wp_override_description_yoast_seo_12345( $schema_output ) {
// get description value from Yoast SEO post meta
$desc = get_post_meta( get_the_ID(), '_yoast_wpseo_metadesc', true);
@DanielSantoro
DanielSantoro / ajaxify-cart.php
Last active November 22, 2022 13:34
AJAX Update Cart thats added to Template File Manually (
// Ensure cart contents update when products are added to the cart via AJAX (place the following in functions.php).
// Used in conjunction with https://gist.github.com/DanielSantoro/1d0dc206e242239624eb71b2636ab148
// Compatible with WooCommerce 3.0+. Thanks to Alex for assisting with an update!
function woocommerce_header_add_to_cart_fragment( $fragments ) {
global $woocommerce;
ob_start();
?>
@moabi
moabi / pure_walker_nav_menu.php
Last active April 20, 2017 03:35
Wordpress walker nav menu to pure.css dropdown menu
<?php
/**
* Will add classes to create a pure.css dropdown menu
* Usage
* wp_nav_menu(array(
* 'theme_location' => 'primary',
* 'menu_class' => 'pure-menu-list',
* 'container_class' => 'pure-menu pure-menu-horizontal',
* 'walker' => new pure_walker_nav_menu
* ));
@JasonHoffmann
JasonHoffmann / gforms_styles.css
Created September 13, 2016 03:22
gravityforms-bootstrap4
.btn > .caret, .gform_button > .caret,
.dropup > .btn > .caret,
.dropup > .gform_button > .caret {
border-top-color: #000 !important;
}
.gform_fields {
padding-left: 0;
list-style: none;
margin-left: -15px;
<?php
use Carbon_Fields\Container\Container;
use Carbon_Fields\Field\Field;
$general_block = [
Field::make('text', 'plain_text_block'),
Field::make('rich_text', 'rich_text_block'),
];
$media_block = [