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 that will automatically update ACF field groups via JSON file update. | |
| * | |
| * @link http://www.advancedcustomfields.com/resources/synchronized-json/ | |
| */ | |
| function jp_sync_acf_fields() { | |
| // vars |
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
| stdClass Object | |
| ( | |
| [id] => | |
| [packed] => Array | |
| ( | |
| [0] => WC_Boxpack_Item Object | |
| ( | |
| [weight] => 7.00 | |
| [height] => 2.50 | |
| [width] => 12.00 |
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
| stdClass Object | |
| ( | |
| [id] => | |
| [packed] => Array | |
| ( | |
| [0] => WC_Boxpack_Item Object | |
| ( | |
| [weight] => 7.00 | |
| [height] => 2.50 | |
| [width] => 12.00 |
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 | |
| /** | |
| * Removes "Town" from label/placeholder in checkout forms | |
| */ | |
| function jp_address_field_filter( $fields ) { | |
| // fields we want to look for | |
| $search = array( | |
| 'billing_city', | |
| 'shipping_city', |
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
| [06-Nov-2015 15:03:43 UTC] $possible_packages: | |
| [06-Nov-2015 15:03:43 UTC] Array | |
| ( | |
| [0] => stdClass Object | |
| ( | |
| [id] => | |
| [packed] => Array | |
| ( | |
| [0] => WC_Boxpack_Item Object | |
| ( |
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 | |
| // go through possible packages | |
| foreach ( $possible_packages as $package ) { | |
| // add the best to a new array | |
| if ( $package->percent == $best_percent ) { | |
| $best_packages[] = $package; | |
| } | |
| } |
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
| Taken from: http://www.deluxeblogtips.com/2012/05/remove-image-sizes.html | |
| If you want to remove files of specific size (for ex. 180x180), run this command: | |
| find . -name *-180x180.* | xargs rm -f | |
| This will remove all files with name *-180x180.* (such as screenshot-180x180.jpg), which are generated by WordPress. | |
| Note: You can only do this if you have privilege of running Linux command on your host/server. If you don’t (in case of using shared host), you should ask your host support to do this for you. | |
| If you want to remove all generated files, run this command: |
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 Email Customer Address | |
| * Plugin URI: https://gist.github.com/BFTrick/7891074 | |
| * Description: Email the site admin when a customer changes their address | |
| * 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 // only copy this line if needed | |
| /** | |
| * This function allows for the editing of the query args for the query that displays the posts/content on the My Membership Content page | |
| * | |
| * Works with Memberships v1.6.3 | |
| * | |
| * @param array $query_args The query arguements | |
| * @param string $type The type of restriction being queried, unused in this case. | |
| * @param int $paged The page, if paged, also unused. | |
| * @see https://codex.wordpress.org/Class_Reference/WP_Query |
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 // Only copy this line if needed | |
| /** | |
| * This function will add zip files back to the allowed mime types WooCommerce can use | |
| * | |
| * @param array $mimes The allowed mime types | |
| * @return array The filtered allowed mime types | |
| */ | |
| function give_zip_back_to_wc( $mimes ) { |