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 | |
| /** | |
| * Fix duplicate users appearing in WP_User_Query by specifying an OR meta query. | |
| * This solution makes no sense but it works. ¯\_(ツ)_/¯ | |
| * | |
| * See: | |
| * 1. https://gist.github.com/RadGH/877ee20d99eee73fb0e933f199d4b8fb | |
| * 2: https://wordpress.stackexchange.com/questions/220307/user-appears-twice-in-a-wp-user-query | |
| * 3: https://core.trac.wordpress.org/ticket/17582 |
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: GF Editable by Radley | |
| Description: Example classes to make a particular gravity form editable on the front-end. | |
| Author: Radley Sustaire | |
| Author URI: https://radleysustaire.com/ | |
| Version: 1.0.0 | |
| */ | |
| // QUICK TEST INSTRUCTIONS: |
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: RS Process Users Daily | |
| Description: Provides an API action for developers which iterates all users once per day, based on cofigurable settings. Usage: <code class="code">add_action( 'aa_process_all_users_daily/user', 'example_process_user' );</code> | |
| Author: Radley Sustaire | |
| Version: 1.1.0 | |
| */ | |
| /* | |
| // EXAMPLE |
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
| # Radley's WP development structure. Git repo should be based in the wp-content folder. | |
| # | |
| # Alternatively, try the Github official WordPress gitignore structure from the document root: | |
| # https://github.com/github/gitignore/blob/master/WordPress.gitignore | |
| # File Extensions | |
| *.log | |
| *.sql | |
| *.sqlite |
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 | |
| /** | |
| * Check expiration date for a set of users. | |
| * | |
| * @return string | |
| */ | |
| function dtl_course_expiry_check( $debug = false ) { | |
| // option to start over when used manually via query string | |
| if ( isset($_REQUEST['startover']) ) update_option( 'dtl-ce-user-index', 0, false ); |
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 | |
| // Step 1. Add the filters surrounding the get_terms (which should be used in your code) | |
| add_filter( 'terms_clauses', 'rs_replace_inner_with_straight_joins', 20 ); | |
| $terms = get_terms( $args ); | |
| remove_filter( 'terms_clauses', 'rs_replace_inner_with_straight_joins', 20 ); | |
| // Step 2. Add to functions.php or similar: | |
| function rs_replace_inner_with_straight_joins( $pieces, $taxonomies = null, $args = null ) { | |
| global $wpdb; | |
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 allows you to specify products as "already packed". They will not be added to separate boxes, and will not be combined with other products. | |
| // This is useful if you have products that are already packed and ready to ship that should not be put into another box. | |
| // | |
| // IMPORTANT: | |
| // The plugin 'WooCommerce UPS Shipping' does not currently support the filter "woocommerce_shipping_ups_skip_packing". | |
| // For now, you must manually edit the UPS plugin directly. The two edits are located below (for version 3.2.18): | |
| // 1. https://gist.github.com/RadGH/ad8d8e599366a27c81bc84dd1f66aaa9 | |
| // 2. https://gist.github.com/RadGH/b7b69f65bbeb7212083058d1d644b0c9 | |
| // |
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 | |
| /** | |
| * Shipping method class. | |
| * | |
| * @package WC_Shipping_UPS | |
| */ | |
| if ( ! defined( 'ABSPATH' ) ) { | |
| exit; // Exit if accessed directly. | |
| } |
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 | |
| /** | |
| * WooCommerce Box Packer | |
| * | |
| * @version 2.0.1 | |
| * @author WooThemes / Mike Jolley | |
| */ | |
| class WC_Boxpack { |
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
| // Usage: | |
| cache.set('name', 'Radley'); | |
| alert( cache.get('name') ); // Displays "Radley" | |
| cache.delete('name'); | |
| alert( cache.get('name') ); // Displays "" | |
| // End of usage. Note that this code must go below the actual cache definition (below) |