These rules are adopted from the AngularJS commit conventions.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Disable PayPal payment method in the checkout if certain | |
* products are present in the cart. | |
* | |
* Add this to your theme's functions.php file | |
*/ | |
add_filter( 'woocommerce_available_payment_gateways', 'filter_gateways', 1); | |
function filter_gateways( $gateways ){ | |
global $woocommerce; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
ONLINE_VERSION=$(curl -s https://www.vagrantup.com/downloads.html) | grep -i 'x86_64.deb' | sed 's/.*\/vagrant_\(.*\)_x86_64\.deb.*/\1/i' | |
SYSTEM_VERSION=$(vagrant --version) | sed 's/^vagrant \(.*\)$/\1/i' | |
VAGRANT_CHECK=$(command -v vagrant >/dev/null 2>&1) | |
#if [ "$VAGRANT_CHECK" = 1 ]; then | |
#novagrant | |
#else |
- Table of contents
- General information
- Terms
- General structure of a test
- WordPress-specific assertions and test functions
- enqueues
- creating posts
- creating terms
- attaching images
- ?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// First Register the Tab by hooking into the 'woocommerce_product_data_tabs' filter | |
add_filter( 'woocommerce_product_data_tabs', 'add_my_custom_product_data_tab' ); | |
function add_my_custom_product_data_tab( $product_data_tabs ) { | |
$product_data_tabs['my-custom-tab'] = array( | |
'label' => __( 'My Custom Tab', 'my_text_domain' ), | |
'target' => 'my_custom_product_data', | |
); | |
return $product_data_tabs; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Aws\Kms\KmsClient; | |
// Somewhere in the controller or model | |
$this->load->config('aws'); | |
// Not needed for EC2 instance role based authorization - for my local instance only | |
$key = $this->config->item('aws_s3_access_key'); | |
$secret = $this->config->item('aws_s3_secret_key'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* gets the current post type in the WordPress Admin | |
*/ | |
function get_current_post_type() { | |
global $post, $typenow, $current_screen; | |
//we have a post so we can just get the post type from that | |
if ( $post && $post->post_type ) { | |
return $post->post_type; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM alpine:3.3 | |
MAINTAINER Tom Maiaroto <tom@outdoorsy.co> | |
# Install packages | |
RUN apk --update --repository http://dl-3.alpinelinux.org/alpine/edge/main add \ | |
freetype-dev \ | |
libjpeg-turbo-dev \ | |
libpng-dev \ | |
libwebp-dev \ | |
php7 \ |
This is a simple way to install mailhog, might not be the best solution for everyone, you can look for repositories, still have to register the binary in the PATH, among other things, this is a manual simple install.
Download mailhog from the releases page on github: https://github.com/mailhog/MailHog/releases
Save the binary at /opt/mailhog/mailhog
Give it executable permission chmod +x /opt/mailhog/mailhog
Download the gist: https://gist.github.com/renatomefi/d133fea9cb5a7b00f91edb24b83d9a31#file-init-d-mailhog-sh
Put it at /etc/init.d/mailhog