This file contains hidden or 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 | |
// Add GA tracking only if user opted-in OR if non-WP.org compliant product. | |
function my_after_purchase_js( $js_function ) { | |
return 'function ( response ) { | |
/** | |
* Since the user just entered their personal & billing information, agreed to the TOS & privacy, | |
* know they are running within a secure iframe from an external domain, they implicitly permit tracking | |
* this purchase. So initizlizing GA here (after the purchase), is legitimate. | |
*/ | |
ga('create', 'UA-XXXXXXX', 'auto'); |
This file contains hidden or 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 | |
/* | |
* Plugin Name: Better errors | |
* Description: Better errors in log | |
* Author: Daniele Scasciafratte | |
* Version: 1.0 | |
* Author URI: http://codeat.co | |
*/ | |
function handleError($code, $description, $file = null, $line = null, $context = null) { |
This file contains hidden or 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
SELECT subscription_line_items.subscription_id, | |
subscriptions.post_status, | |
product.id AS product_id, | |
product.post_title AS product_name, | |
product.post_status, | |
mo.product_type, | |
subscription_line_items.qty, | |
subscription_line_items.product_total, | |
subscription_meta.currency, | |
subscription_meta.billing_period, |
This file contains hidden or 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 | |
/** | |
* Sports-bench-team-rest-controller.php | |
* | |
* Creates a REST API controller for teams | |
* | |
* @package Sports Bench | |
* | |
* @author Jacob Martella | |
* |
This file contains hidden or 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 | |
/* | |
This script will allow you to send a custom email from anywhere within wordpress | |
but using the woocommerce template so that your emails look the same. | |
Created by [email protected] on 27th of July 2017 | |
Put the script below into a function or anywhere you want to send a custom email | |
*/ |
This file contains hidden or 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 | |
add_action( 'woocommerce_email_before_order_table', 'add_order_email_instructions', 10, 2 ); | |
function add_order_email_instructions( $order, $sent_to_admin ) { | |
$shipping_method = @array_shift( $order->get_shipping_methods() ); | |
$shipping_method_id = $shipping_method['method_id']; | |
if ( ! $sent_to_admin ) { |
This file contains hidden or 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
remove_action( 'woocommerce_order_details_after_order_table', 'woocommerce_order_again_button' ); | |
//Did this help? Donate me some BTC: 1BEsm8VMkYhSFJ92cvUYwxCtsfsB2rBfiG |
This file contains hidden or 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 | |
// Define a constant to use with html emails | |
define("HTML_EMAIL_HEADERS", array('Content-Type: text/html; charset=UTF-8')); | |
// @email - Email address of the reciever | |
// @subject - Subject of the email | |
// @heading - Heading to place inside of the woocommerce template | |
// @message - Body content (can be HTML) | |
function send_email_woocommerce_style($email, $subject, $heading, $message) { |
This file contains hidden or 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
# Install brew | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
# Install composer | |
brew install homebrew/php/composer | |
### PHPCS | |
composer global require "squizlabs/php_codesniffer=*" | |
# Add to your .bash_profile |
This file contains hidden or 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 | |
// Function to change the `Timeline and History Slider Pro` post type slug | |
function wphtsp_modify_timeline_post_slug( $slug ){ | |
$slug = 'timeline_slider_slug'; // Write your desired slug | |
return $slug; | |
} | |
add_filter( 'wphtsp_post_slug', 'wphtsp_modify_timeline_post_slug' ); | |
?> |