Skip to content

Instantly share code, notes, and snippets.

View timothyjensen's full-sized avatar

Tim Jensen timothyjensen

View GitHub Profile
@seothemes
seothemes / style.scss
Created May 22, 2019 01:51
Gravity Forms SCSS
/* ## Gravity Forms
--------------------------------------------- */
.gform_heading,
.gform_body,
.gform_footer {
clear: both;
}
.gform_heading {
@seothemes
seothemes / customizer-additional-js.php
Last active July 20, 2018 03:19
Adds an Additional JS control to the Customizer and outputs the JS in the site footer.
<?php
/**
* Additional JS Customizer Control
*
* @author Lee Anthony
* @link https://seothemes.com
* @copyright Copyright © 2018 SEO Themes
* @license GPL-2.0-or-later
*/
@ianmjones
ianmjones / build-as3cf-aws2.sh
Last active August 28, 2024 03:52
A script for downloading the AWS PHP SDK v2, stripping down to S3 functionality and then applying a custom namespace.
#!/usr/bin/env bash
set -e
if [ ! -d src/amazon-s3-and-cloudfront ]; then
echo 'This script must be run from the repository root.'
exit 1
fi
for PROG in composer find sed
@keesiemeijer
keesiemeijer / setup-phpunit.sh
Last active September 5, 2024 01:56
Setup PHPUnit for use in the Local by Flywheel app
#!/usr/bin/env bash
# ===============================================================================
# Script to install PHPUnit in the Local by Flywheel Mac app
# These packages are installed
#
# PHPUnit, curl wget, rsync, git, subversion and composer.
#
# WordPress is installed in the `/tmp/wordpress` directory for use by PHPUnit.
# The WordPress test suite is installed in the `/tmp/wordpress-tests-lib` directory.
@sblomberg
sblomberg / class-gravity-forms-customizations.php
Last active March 16, 2017 18:32
Enable Gravity Forms honeypot by default
<?php
class Gravity_Forms_Customizations {
public static function init() {
add_action( 'gform_after_save_form', array( __CLASS__, 'enable_honeypot_on_new_form_creation' ), 10, 2 );
}
public static function enable_honeypot_on_new_form_creation( $form, $is_new ) {
if ( $is_new ) {
$form['enableHoneypot'] = true;
// XPath CheatSheet
// To test XPath in your Chrome Debugger: $x('/html/body')
// http://www.jittuu.com/2012/2/14/Testing-XPath-In-Chrome/
// 0. XPath Examples.
// More: http://xpath.alephzarro.com/content/cheatsheet.html
'//hr[@class="edge" and position()=1]' // every first hr of 'edge' class
@thagxt
thagxt / AJAX add to cart button on Shop page in WooCommerce.php
Created April 3, 2014 14:27
AJAX add to cart button on Shop page in WooCommerce
WTF: Get the AJAX add to cart button on Shop/Category/Search pages in WooCommerce. (AJAX works only for simple products)
HOW:
1) create a directory, name it "woocommerce" put it in your theme root.
2) copy/pasta from woocommerce plugin directory the content-product.php file
3) at the end of the (content-product.php) file, paste the code below:
<?php
global $product;
echo apply_filters( 'woocommerce_loop_add_to_cart_link',
@eduardozulian
eduardozulian / wp-get-image-sizes.php
Created September 6, 2013 18:23
Get all the registered image sizes along with their dimensions
<?php
/**
* Get all the registered image sizes along with their dimensions
*
* @global array $_wp_additional_image_sizes
*
* @link http://core.trac.wordpress.org/ticket/18947 Reference ticket
* @return array $image_sizes The image sizes
*/
function _get_all_image_sizes() {
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/