Skip to content

Instantly share code, notes, and snippets.

View DeveloperWil's full-sized avatar

Wil Brown DeveloperWil

View GitHub Profile
@saltnpixels
saltnpixels / gform_stripe_subscriptions.php
Created October 10, 2017 15:25
Gravity forms stripe cancel from front end
<?php
/**
* Payment subscriptions and updating billing and cancelling subscriptions takes place with these hooks
* We need the stripe customer user id for updating billing
* we need the entry id of subscription so we can cancel it.
*/
/**
* @param $entry
@rymawby
rymawby / stripe-credit-card-numbers.md
Last active April 19, 2024 13:27
Stripe test credit card numbers for use in development

#Test credit card numbers to use when developing with Stripe

4242424242424242 Visa

4012888888881881 Visa

4000056655665556 Visa (debit)

@JudeRosario
JudeRosario / wc-free-checkout-fields.php
Last active July 12, 2018 21:57 — forked from bekarice/wc-free-checkout-fields.php
Simplify WooCommerce checkout fields for free checkouts
<?php
function sv_free_checkout_fields() {
global $woocommerce ;
// Bail we're not at checkout, or if we're at checkout but payment is needed
if ( ! is_checkout() || ( is_checkout() && WC()->cart->needs_payment() ) ) {
return;
}
@retlehs
retlehs / header.php
Created April 29, 2015 04:55
Sage header template for Bootstrap top navbar component
<?php
// This file assumes that you have included the nav walker from https://github.com/twittem/wp-bootstrap-navwalker
// somewhere in your theme.
?>
<header class="banner navbar navbar-default navbar-static-top" role="banner">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only"><?= __('Toggle navigation', 'sage'); ?></span>
@rglastra
rglastra / gist:3ef9582c6292470a1743
Last active September 2, 2022 16:23
Check available certs in ca-certificates.crt by subject.
#!/bin/bash
echo "All certificates in ca-certificates.crt, listed by subject:"
awk -v cmd='openssl x509 -noout -subject' '/BEGIN/{close(cmd)};{print | cmd}' < /etc/ssl/certs/ca-certificates.crt
echo "All certificates in ca-certificates.crt, listed by subject, check for presence of VeriSign's 'Class 3 Public Primary - G5':"
awk -v cmd='openssl x509 -noout -subject' '/BEGIN/{close(cmd)};{print | cmd}' < /etc/ssl/certs/ca-certificates.crt | grep "G5"
@kjbrum
kjbrum / wp_gravity_forms_add_empty_dropdown_option.php
Last active March 22, 2021 23:23
Add a blank option to a Gravity Forms select element.
<?php
/**
* Add a blank option to a Gravity Forms dropdown
*
* @param object $form The Gravity Form
* @return object $form The modified Gravity Form
*/
function wp_gravity_forms_add_empty_dropdown_option( $form ) {
// Select the correct form, then set the id of the field(s) we need to change
if( $form['id'] == 1 ) {
@markjaquith
markjaquith / nginx.conf
Last active December 25, 2022 15:55
My WordPress Nginx setup
upstream phpfpm {
server unix:/var/run/php5-fpm.sock;
}
upstream hhvm {
server unix:/var/run/hhvm/hhvm.sock;
}
# SSL
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
@salcode
salcode / .gitignore
Last active February 10, 2024 10:56
See https://salferrarello.com/wordpress-gitignore/ for the latest version of my WordPress .gitignore file
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore
@BFTrick
BFTrick / woocommerce-remove-virtual-billing-fields.php
Last active February 19, 2024 17:23
Remove the billing address fields for free virtual orders in WooCommerce
<?php
/**
* Plugin Name: WooCommerce Remove Billing Fields for Free Virtual Products
* Plugin URI: https://gist.github.com/BFTrick/7873168
* Description: Remove the billing address fields for free virtual orders
* Author: Patrick Rauland
* Author URI: http://patrickrauland.com/
* Version: 2.0
*
* This program is free software: you can redistribute it and/or modify
@ronalfy
ronalfy / gravity-forms-disable-autocomplete.php
Last active March 28, 2022 19:41
Disable autocomplete on the front-end for Gravity Forms
<?php
add_filter( 'gform_form_tag', 'gform_form_tag_autocomplete', 11, 2 );
function gform_form_tag_autocomplete( $form_tag, $form ) {
if ( is_admin() ) return $form_tag;
if ( GFFormsModel::is_html5_enabled() ) {
$form_tag = str_replace( '>', ' autocomplete="off">', $form_tag );
}
return $form_tag;
}
add_filter( 'gform_field_content', 'gform_form_input_autocomplete', 11, 5 );