Skip to content

Instantly share code, notes, and snippets.

View christopherarter's full-sized avatar
❤️
You are not an imposter. You belong, and we're lucky to have you.

Chris Arter christopherarter

❤️
You are not an imposter. You belong, and we're lucky to have you.
View GitHub Profile
@mikejolley
mikejolley / gist:1547491
Created January 1, 2012 14:38
WooCommerce - A filter to add a tracking (or any other field for that matter) to order emails to customers.
/* To use:
1. Add this snippet to your theme's functions.php file
2. Change the meta key names in the snippet
3. Create a custom field in the order post - e.g. key = "Tracking Code" value = abcdefg
4. When next updating the status, or during any other event which emails the user, they will see this field in their email
*/
add_filter('woocommerce_email_order_meta_keys', 'my_custom_order_meta_keys');
function my_custom_order_meta_keys( $keys ) {
$keys[] = 'Tracking Code'; // This will look for a custom field called 'Tracking Code' and add it to emails
@Adirael
Adirael / fix-wordpress-permissions.sh
Created August 17, 2012 23:16
Fix wordpress file permissions
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
@aaroneaton
aaroneaton / Navigation.php
Last active March 7, 2017 19:10
Using the Zurb Foundation Top Bar with WordPress menus
<?php
class Navigation {
public function __construct() {
// Move the navigation to the header element
remove_action( 'genesis_after_header', 'genesis_do_nav' );
remove_action( 'genesis_site_title', 'genesis_seo_site_title' );
// remove_action( 'genesis_header', )
<?php
add_action( 'gform_enqueue_scripts_10', 'enqueue_dropdown_script', 10, 2 );
function enqueue_dropdown_script( $form, $is_ajax ) {
wp_register_script( 'jquery-dropdown', 'js/jquery.dropdown.js', array( 'jquery' ) );
wp_enqueue_script( 'gform-jquery-dropdown', 'js/gravityforms.dropdown.js', array( 'jquery', 'jquery-dropdown' ) );
}
@hoandang
hoandang / php-docker-ext
Created May 20, 2017 01:12
Complete list of php docker ext
RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN docker-php-ext-install mcrypt
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/