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
| /** | |
| * This code snippet removes JavaScript and CSS files loaded from WooCommerce if they are not necessary. | |
| * | |
| * Please test this on a staging copy of your website before putting this into the functions.php of your live website. | |
| */ | |
| add_action( 'wp_enqueue_scripts', 'my_remove_woo_assets', 99 ); | |
| function my_remove_woo_assets() { | |
| if ( function_exists( 'is_woocommerce' ) ) { // Check if Woo is installed. | |
| if ( ! is_woocommerce() && ! is_cart() && ! is_checkout() ) { // Only run on non-Woo pages. | |
| // Remove unnecessary stylesheets. |
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
| Please navigate to file includes/admin/reports/tabs/class-referrals-reports-tab.php and replace the total unpaid earning tile code with the following code: | |
| $total_unpaid_earnings = 0; | |
| $referrals = affiliate_wp()->referrals->get_referrals( array( | |
| 'number' => -1, | |
| 'status' => 'unpaid', | |
| 'affiliate_id' => $this->affiliate_id, | |
| 'date' => $this->date_query ? $this->date_query : '' | |
| ) ); | |
| foreach ( $referrals as $referral ) { |
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 | |
| /** | |
| * The purpose of this code is to show how you can use theme mods that will fall back to | |
| * the already-set mods of the parent theme. So, when a child theme is active, the code | |
| * checks, in the following order: 1) child theme mod, 2) parent theme mod, 3) default. | |
| */ | |
| function jt_get_theme_mod( $name, $default = false ) { | |
| if ( is_child_theme() ) |
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
| /* example of using BP_Group_Extension | |
| * replace 'test' with something else - remember that it is case-sensitive | |
| * checks for any selected Group Types in the 'Settings' step | |
| */ | |
| function test_add_group_extension() { | |
| if ( bp_is_active( 'groups' ) ) : |