Skip to content

Instantly share code, notes, and snippets.

View jeremycaris's full-sized avatar

Jeremy Caris jeremycaris

View GitHub Profile
@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' ] );
@hereswhatidid
hereswhatidid / gforms-merge-tag.php
Last active July 24, 2024 21:34
Create a custom Gravity Forms merge tag
<?php
namespace HWID\SampleCode;
class GravityForms {
public static function init() {
add_filter( 'gform_custom_merge_tags', [ 'HWID\SampleCode\GravityForms', 'custom_merge_tags' ], 10, 4 );
add_filter( 'gform_replace_merge_tags', [ 'HWID\SampleCode\GravityForms', 'replace_merge_tags' ], 10, 3 );
}
/**
@spivurno
spivurno / gw-gravity-forms-display-prices-for-choice-based-product-fields.php
Last active May 19, 2023 21:48
Gravity Wiz // Gravity Forms // Display Price for Drop Down and Radio Button Product Fields
<?php
/**
* Gravity Wiz // Gravity Forms // Display Price for Drop Down and Radio Button Product Fields
* http://gravitywiz.com/
* Source: https://www.gravityhelp.com/documentation/article/gform_field_choice_markup_pre_render/#2-include-price-for-product-fields
*/
add_filter( 'gform_field_choice_markup_pre_render', function ( $choice_markup, $choice, $field, $value ) {
if ( $field->type == 'product' ) {
$new_string = sprintf( '>%s - %s<', $choice['text'], GFCommon::to_money( $choice['price'] ) );
@xlplugins
xlplugins / gravityxl-scheduled-export-entry.php
Last active July 6, 2023 03:38
Schedule Export for Gravity Forms Entries
<?php
/**
* @package Gravity XL Scheduled Entries Export
* @version 1.0
* @name gravityxl -scheduled-entries-export
* @author Gravity XL
*/
/**
* Schedule gform Entry export
*
<?php
class Sasha_pl_uploads_url {
function __construct() {
add_filter( 'pl_uploads_url', array( $this, 'filter' ) );
}
function filter( $url ) {
return 'http://my.cdn.url/wp-content/uploads';
}
}
@joe-dempsey
joe-dempsey / shopify-sub.liquid
Last active March 19, 2024 21:51
Shopify menu with submenu
{% comment %} this is a barebones menu with submenu items for Shopify {% endcomment %}
{% comment %} see shopify docu for creating submenu items: https://help.shopify.com/manual/sell-online/online-store/menus-and-links#create-a-drop-down-menu {% endcomment %}
{% comment %} first assign the menu - this is the only thing you need to change {% endcomment %}
{% assign linklist = settings.collections_nav %}
{% comment %} in the above line change the collections_nav to the handle of your main naivgation {% endcomment %}
{% comment %} the code below will do the rest {% endcomment %}
@JenniferMack
JenniferMack / md-toc.rb
Last active July 18, 2024 12:00
Create a table of contents for Ulysses markdown
#!/usr/bin/env ruby
toc = "# Table of Contents\n"
newmd = ""
ARGF.each_line do |line|
newmd << line
next if !line.start_with?("#")
heading = line.gsub("#", "").strip
@yratof
yratof / functions.php
Created March 25, 2015 16:43
Advanced Custom Fields - Update Gallery with Gravity Forms
$gravity_form_id = 6; // gravity form id, or replace {$gravity_form_id} below with this number
add_filter("gform_after_submission_{$gravity_form_id}", 'jdn_set_post_acf_gallery_field', 10, 2);
function jdn_set_post_acf_gallery_field($entry, $form)
{
$gf_images_field_id = 42; // the upload field id
$acf_field_id = 'field_54804833b3067'; // the acf gallery field id
// get post
@katienelson
katienelson / slide-up-fade-in.html
Last active September 24, 2019 18:05
Slide Up Fade In - Keyframe animation and CSS class. Apply .slide-up-fade-in to element you wish to apply the effect. Demo on http://codepen.io/katienelson/pen/KwXEzN
<div class="outer-square">
<div class="square slide-up-fade-in">
<h3 class="slide-up-fade-in">Title</h3>
<p class="slide-up-fade-in">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
<p class="slide-up-fade-in">Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
<div class="clearfix"></div>
</div>
@j0lvera
j0lvera / social-options-wp.md
Last active October 15, 2017 15:04
How to add social icons using Option Tree and Font Awesome in WordPress

in header.php

<?php
  if ( function_exists( 'ot_get_option' ) ) {
    $social_media_channels = array(
      "Facebook" => "fa fa-facebook-square",
      "Twitter" => "fa fa-twitter-square",
      "Google+" => "fa fa-google-plus-square",
 "Linkedin" =&gt; "fa fa-linkedin-square",