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: WooCommerce Disable Table Rate Shipping when UPS Rates are Present | |
| * Plugin URI: https://gist.github.com/BFTrick/ab2841ca0daaca413379/ | |
| * Description: A simple plugin that disables the Table Rate Shipping methods when UPS rates are available. | |
| * Author: Patrick Rauland | |
| * Author URI: http://patrickrauland.com/ | |
| * Version: 1.0 | |
| * | |
| * This program is free software: you can redistribute it and/or modify |
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: Doge Home Page | |
| * Plugin URI: https://gist.github.com/BFTrick/e73cfa53cf64182d02ae | |
| * Description: Dogeify the front page of your site | |
| * Author: Patrick Rauland | |
| * Author URI: http://patrickrauland.com/ | |
| * Version: 1.0 | |
| * | |
| * This program is free software: you can redistribute it and/or modify |
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
| curl -O https://wordpress.org/latest.zip | |
| unzip latest.zip | |
| mv wordpress site | |
| rm latest.zip |
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: WooCommerce Display Currency Code in Currency Symbol | |
| * Plugin URI: https://gist.github.com/BFTrick/10681832 | |
| * Description: Add the currency code to the currency symbol in WooCommerce. Ex. USD $. | |
| * Author: Patrick Rauland | |
| * Author URI: http://patrickrauland.com/ | |
| * Version: 1.0 | |
| * | |
| * This program is free software: you can redistribute it and/or modify |
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 | |
| foreach ( $package['contents'] as $item_id => $values ) { | |
| // skip products that dont need shipping | |
| if ( $values['data']->needs_shipping() ) { | |
| // make sure a weight is set | |
| if ( $values['data']->get_weight() ) { | |
| $item_weight = $values['data']->get_weight(); | |
| // do something with the weight here | |
| // ... |
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 | |
| /** | |
| * Return the permalink of the shop page for the continue shopping redirect filter | |
| * | |
| * @param string $return_to | |
| * @return string | |
| */ | |
| function my_woocommerce_continue_shopping_redirect( $return_to ) { | |
| return get_permalink( wc_get_page_id( 'shop' ) ); | |
| } |
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
| UPDATE wp_posts | |
| SET post_status="publish" | |
| WHERE post_type="shop_coupon" |
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: Cancelled Subscriptions Hook | |
| Plugin URI: https://gist.github.com/BFTrick/8696222 | |
| Description: Hook into the WooCommerce Cancelled Subscriptions hook and print the data. | |
| Version: 1.0.0 | |
| Author: Patrick Rauland | |
| Author URI: http://www.patrickrauland.com | |
| */ |
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: Ninja Forms - Get User Analytics Fields | |
| Plugin URI: https://gist.github.com/BFTrick/8355697 | |
| Description: Get the fields from the User Analytics Ninja Forms extension | |
| Version: 1.0.0 | |
| Author: Patrick Rauland | |
| Author URI: http://www.patrickrauland.com | |
| */ |
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 my_ninja_forms_hide_unchecked( ) { | |
| global $ninja_forms_processing; | |
| // get all the user submitted values | |
| $all_fields = $ninja_forms_processing->get_all_fields(); | |
| if ( is_array( $all_fields ) ) { | |
| // loop through each of our submitted values. | |
| foreach ( $all_fields as $key => $value ) { |