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
So you've cloned somebody's repo from github, but now you want to fork it and contribute back. Never fear! | |
Technically, when you fork "origin" should be your fork and "upstream" should be the project you forked; however, if you're willing to break this convention then it's easy. | |
* Off the top of my head * | |
1. Fork their repo on Github | |
2. In your local, add a new remote to your fork; then fetch it, and push your changes up to it | |
git remote add my-fork [email protected] |
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 | |
ob_start(); | |
var_dump($this); | |
error_log(ob_get_clean()); | |
?> |
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
/** | |
* Optimize WooCommerce Scripts | |
* Remove WooCommerce Generator tag, styles, and scripts from non WooCommerce pages. | |
*/ | |
add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 ); | |
function child_manage_woocommerce_styles() { | |
//remove generator meta tag | |
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) ); |
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
# change these vars | |
SET @old_id = 2; | |
SET @new_id = 1; | |
# change the db table prefix here | |
UPDATE IGNORE wp_pmpro_membership_levels SET id = @new_id WHERE id = @old_id; | |
UPDATE IGNORE wp_pmpro_discount_codes_levels SET level_id = @new_id WHERE level_id = @old_id; | |
UPDATE IGNORE wp_pmpro_membership_orders SET membership_id = @new_id WHERE membership_id = @old_id; | |
UPDATE IGNORE wp_pmpro_memberships_categories SET membership_id = @new_id WHERE membership_id = @old_id; | |
UPDATE IGNORE wp_pmpro_memberships_pages SET membership_id = @new_id WHERE membership_id = @old_id; |
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
# Version key/value should be on his own line | |
PACKAGE_VERSION=$(cat package.json \ | |
| grep version \ | |
| head -1 \ | |
| awk -F: '{ print $2 }' \ | |
| sed 's/[",]//g' \ | |
| tr -d '[[:space:]]') | |
echo $PACKAGE_VERSION |
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
/* | |
Add last paymenet date and next payment date to the members list and export CSV | |
Add this code into a custom plugin or your active theme's functions.php. | |
Note that "last payment" value will get the last order in "success", "cancelled", or "" status. | |
(Oddly enough, cancelled here means that the membership was cancelled, not the order.) | |
The "next payment" value is an estimate based on the billing cycle of the subscription and the last order date. | |
It may be off form the actual recurring date set at the gateway, especially if the subscription was updated at the gateway. |
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 | |
/** | |
* Make sure the function does not exist before defining it | |
*/ | |
if( ! function_exists( 'remove_class_filter' ) ){ | |
/** | |
* Remove Class Filter Without Access to Class Object | |
* | |
* In order to use the core WordPress remove_filter() on a filter added with the callback |
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
{ fontWeight: '100' }, // Thin | |
{ fontWeight: '200' }, // Ultra Light | |
{ fontWeight: '300' }, // Light | |
{ fontWeight: '400' }, // Regular | |
{ fontWeight: '500' }, // Medium | |
{ fontWeight: '600' }, // Semibold | |
{ fontWeight: '700' }, // Bold | |
{ fontWeight: '800' }, // Heavy | |
{ fontWeight: '900' }, // Black |
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 | |
\add_filter( 'wc_add_to_cart_message', function( $string, $product_id = 0 ) { | |
$start = strpos( $string, '<a href=' ) ?: 0; | |
$end = strpos( $string, '</a>', $start ) ?: 0; | |
return substr( $string, $end ) ?: $string; | |
} ); |
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
add_filter('woocommerce_single_product_image_thumbnail_html','wc_remove_link_on_thumbnails' ); | |
function wc_remove_link_on_thumbnails( $html ) { | |
return strip_tags( $html,'<img>' ); | |
} | |
//Did this help? Donate me some BTC: 1BEsm8VMkYhSFJ92cvUYwxCtsfsB2rBfiG |
OlderNewer