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
| /** | |
| * Retrieves an array of all network sites | |
| * | |
| * @since 1.0 | |
| * @return array | |
| */ | |
| function get_network_sites() { | |
| global $wpdb; | |
| $blogs = $wpdb->get_results(" |
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 | |
| /** | |
| * Sets a user's buddypress member type(s) globally across all sites | |
| * | |
| * @since 1.0 | |
| */ | |
| function bp_set_global_member_type( $user_id = 0, $member_type = '', $append = false ) { | |
| // Append new member type to global member type array | |
| if ( $append == true ) { |
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 sync_member_type( $user_id = 0 ) { | |
| if ( empty( $user_id ) ) | |
| $user_id = get_current_user_id(); | |
| $memb_types = bp_get_member_type( $user_id, false ); | |
| switch_to_blog( 3 ); |
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 | |
| $affiliate_id = affwp_get_affiliate_id(); | |
| ?> | |
| <div id="affwp-affiliate-dashboard-referrals" class="affwp-tab-content"> | |
| <h4><?php _e( 'Referrals', 'affiliate-wp' ); ?></h4> | |
| <?php | |
| $per_page = 30; |
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 | |
| /** | |
| * Add Driver Status column to the exported affiliates CSV file | |
| * | |
| * @since 1.0 | |
| */ | |
| function affwp_mobbyd_export_affiliates_csv_cols( $cols ) { | |
| $cols['driver_status'] = 'Driver Status'; | |
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
| // Run if AffiliateWP is active | |
| if ( class_exists( 'Affiliate_WP' ) ) { | |
| /** | |
| * Removes the Website URL field from the list of required affiliate registration form fields | |
| * | |
| * @return array | |
| */ | |
| function affwp_remove_url_field( $required_fields = array() ) { | |
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
| // Run if AffiliateWP MLM is Active | |
| if ( class_exists( 'AffiliateWP_Multi_Level_Marketing' ) ) { | |
| /** | |
| * Removes Specific MLM Affiliate Data from the Sub Affiliates Tooltip (Upline Only) | |
| * | |
| * @since 1.1.1 | |
| * @return array | |
| */ | |
| function affwp_mlm_remove_upline_aff_data( $aff_data = array(), $affiliate_id = 0 ) { |
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 | |
| /** | |
| * @package nmbs | |
| */ | |
| $col = empty($shortcode_atts["col"])? 3:intval($shortcode_atts["col"]); | |
| $smcol = $col/1.5; | |
| $col = empty($col)? 1:($col >= 12)? 12:$col; | |
| $smcol = empty($smcol)? 1:($smcol >= 12)? 12:$smcol; | |
| $col = intVal(12/$col); | |
| $smcol = intVal(12/$smcol); |
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 | |
| // Prevent overwriting existing lifetime affiliate | |
| if ( get_user_meta( $user_id, 'affwp_lc_affiliate_id', true ) ) { | |
| if( ! (bool) apply_filters( 'affwp_lc_update_affiliate', false, $affiliate_id, $user_id, $referral, $this->context ) ) { | |
| return true; // Allow extensions to update lifetime affiliates | |
| } | |
| } |
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 | |
| // Get user's rank progress | |
| function get_mycred_users_rank_progress( $user_id, $show_rank ) { | |
| global $wpdb; | |
| if ( ! function_exists( 'mycred' ) ) return ''; | |
| // Change rank data to displayed user when on a user's profile | |
| if ( function_exists( 'bp_is_user' ) && bp_is_user() && empty( $user_id ) ) { |