Plugin Directory

Changeset 1913082


Ignore:
Timestamp:
07/22/2018 05:27:54 PM (8 years ago)
Author:
plusplugins
Message:

Release 2.1.0, see readme.txt for the changelog.

Location:
profile-tabs-for-ultimate-member
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • profile-tabs-for-ultimate-member/tags/2.1.0/core.php

    r1896830 r1913082  
    110110
    111111        $posts        = get_posts( $args );
    112         $user_role    = get_user_meta( get_current_user_id(), 'role', true );
    113         $profile_role = get_user_meta( um_profile_id(), 'role', true );
     112        $user_role    = UM()->roles()->get_all_user_roles( get_current_user_id() );
     113        $profile_role = UM()->roles()->get_all_user_roles( um_profile_id() );
    114114
    115115        foreach ( $posts as $post ) {
     
    132132
    133133            if ( ! empty( $have_roles ) ) {
    134                 if ( ! in_array( $profile_role, $have_roles ) ) {
     134                if ( count( array_intersect( $profile_role, $have_roles ) ) <= 0 ) {
    135135                    continue;
    136136                }
    137137            }
    138138
    139             // if we are here then the profile has that tab - just need to check if user may view
    140 
     139            // if we are here then the profile has that tab - just need to check if user may view
    141140            if ( $private_tab ) {
    142141
    143142                // private tab - user on another profile but can not view
    144                 if ( um_profile_id() != get_current_user_id() && ! in_array( $user_role, $view_roles ) ) {
     143                if ( um_profile_id() != get_current_user_id() && count( array_intersect( $user_role, $view_roles ) ) <= 0 ) {
    145144                    continue;
    146145                }
    147146
    148147            } else {
     148
    149149                // public tab - user can not view tab
    150150                if ( ! empty( $view_roles ) ) {
    151                     if ( ! in_array( $user_role, $view_roles ) ) {
     151                    if ( count( array_intersect( $user_role, $view_roles ) ) <= 0 ) {
    152152                        continue;
    153153                    }
     
    201201                } );
    202202            }
    203 
    204203        }
    205204
    206205        return $tabs;
    207206    }
    208 
    209207}
  • profile-tabs-for-ultimate-member/tags/2.1.0/pp-tabs.php

    r1896830 r1913082  
    55 * Description: Add custom profile tabs to your Ultimate Member site with content area and privacy settings.
    66 * Author: PlusPlugins
    7  * Version: 2.0.2
     7 * Version: 2.1.0
    88 * Author URI: https://www.plusplugins.com
    99 * Text Domain: profile-tabs-for-ultimate-member
     
    1313define( 'PP_TABS_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
    1414define( 'PP_TABS_PLUGIN_URI', plugin_dir_url( __FILE__ ) );
    15 define( 'PP_TABS_REQUIRES', '2.0.4' );
     15define( 'PP_TABS_REQUIRES', '2.0.5' );
    1616
    1717require_once PP_TABS_PLUGIN_DIR . 'init.php';
  • profile-tabs-for-ultimate-member/tags/2.1.0/readme.txt

    r1896830 r1913082  
    33Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=TY7RLMFUCPVE4
    44Tags: ultimate member, ultimatemember, user profiles, tabs, profile tabs, custom tabs, user tabs, member tabs, reorder tabs, sort tabs, membership tabs, extra tabs
    5 Requires at least: 4.1, Ultimate Member: 2.0.4
    6 Tested up to: 4.9.6, Ultimate Member: 2.0.17
     5Requires at least: 4.1
     6Tested up to: 4.9.7
    77Requires PHP: 5.6
    8 Stable tag: 2.0.2
     8Stable tag: 2.1.0
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    8383== Changelog ==
    8484
     85= 2.1.0 =
     86* Fix: User Role issue with tabs
     87* Update: Confirm UM 2.0 User Roles Logic compatibility
     88* Update: Confirm WordPress 4.9.7 compatibility
     89
    8590= 2.0.2 =
    8691* Fix: Timeout issue when UM Profile Form shortcode is used
  • profile-tabs-for-ultimate-member/trunk/core.php

    r1896830 r1913082  
    110110
    111111        $posts        = get_posts( $args );
    112         $user_role    = get_user_meta( get_current_user_id(), 'role', true );
    113         $profile_role = get_user_meta( um_profile_id(), 'role', true );
     112        $user_role    = UM()->roles()->get_all_user_roles( get_current_user_id() );
     113        $profile_role = UM()->roles()->get_all_user_roles( um_profile_id() );
    114114
    115115        foreach ( $posts as $post ) {
     
    132132
    133133            if ( ! empty( $have_roles ) ) {
    134                 if ( ! in_array( $profile_role, $have_roles ) ) {
     134                if ( count( array_intersect( $profile_role, $have_roles ) ) <= 0 ) {
    135135                    continue;
    136136                }
    137137            }
    138138
    139             // if we are here then the profile has that tab - just need to check if user may view
    140 
     139            // if we are here then the profile has that tab - just need to check if user may view
    141140            if ( $private_tab ) {
    142141
    143142                // private tab - user on another profile but can not view
    144                 if ( um_profile_id() != get_current_user_id() && ! in_array( $user_role, $view_roles ) ) {
     143                if ( um_profile_id() != get_current_user_id() && count( array_intersect( $user_role, $view_roles ) ) <= 0 ) {
    145144                    continue;
    146145                }
    147146
    148147            } else {
     148
    149149                // public tab - user can not view tab
    150150                if ( ! empty( $view_roles ) ) {
    151                     if ( ! in_array( $user_role, $view_roles ) ) {
     151                    if ( count( array_intersect( $user_role, $view_roles ) ) <= 0 ) {
    152152                        continue;
    153153                    }
     
    201201                } );
    202202            }
    203 
    204203        }
    205204
    206205        return $tabs;
    207206    }
    208 
    209207}
  • profile-tabs-for-ultimate-member/trunk/pp-tabs.php

    r1896830 r1913082  
    55 * Description: Add custom profile tabs to your Ultimate Member site with content area and privacy settings.
    66 * Author: PlusPlugins
    7  * Version: 2.0.2
     7 * Version: 2.1.0
    88 * Author URI: https://www.plusplugins.com
    99 * Text Domain: profile-tabs-for-ultimate-member
     
    1313define( 'PP_TABS_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
    1414define( 'PP_TABS_PLUGIN_URI', plugin_dir_url( __FILE__ ) );
    15 define( 'PP_TABS_REQUIRES', '2.0.4' );
     15define( 'PP_TABS_REQUIRES', '2.0.5' );
    1616
    1717require_once PP_TABS_PLUGIN_DIR . 'init.php';
  • profile-tabs-for-ultimate-member/trunk/readme.txt

    r1896830 r1913082  
    33Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=TY7RLMFUCPVE4
    44Tags: ultimate member, ultimatemember, user profiles, tabs, profile tabs, custom tabs, user tabs, member tabs, reorder tabs, sort tabs, membership tabs, extra tabs
    5 Requires at least: 4.1, Ultimate Member: 2.0.4
    6 Tested up to: 4.9.6, Ultimate Member: 2.0.17
     5Requires at least: 4.1
     6Tested up to: 4.9.7
    77Requires PHP: 5.6
    8 Stable tag: 2.0.2
     8Stable tag: 2.1.0
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    8383== Changelog ==
    8484
     85= 2.1.0 =
     86* Fix: User Role issue with tabs
     87* Update: Confirm UM 2.0 User Roles Logic compatibility
     88* Update: Confirm WordPress 4.9.7 compatibility
     89
    8590= 2.0.2 =
    8691* Fix: Timeout issue when UM Profile Form shortcode is used
Note: See TracChangeset for help on using the changeset viewer.