Plugin Directory

Changeset 3096662


Ignore:
Timestamp:
06/03/2024 09:40:07 AM (22 months ago)
Author:
expresstechsoftware
Message:

Removed duplicate Discord role name from the 'Connect' button on the account student page.

Location:
connect-learndash-and-discord
Files:
166 added
4 edited

Legend:

Unmodified
Added
Removed
  • connect-learndash-and-discord/trunk/CHANGELOG.txt

    r3071651 r3096662  
     1= 1.0.14 =
     2- Removed duplicate Discord role name from the 'Connect' button on the account student page.
     3
    14= 1.0.13 =
    25- Updated plugin to support WordPress version 6.5
  • connect-learndash-and-discord/trunk/README.txt

    r3071651 r3096662  
    88Tested up to: 6.5
    99Requires PHP: 7.0
    10 Stable tag: 1.0.13
     10Stable tag: 1.0.14
    1111License: GPLv2
    1212License URI: https://www.gnu.org/licenses/gpl-2.0.html
  • connect-learndash-and-discord/trunk/learndash-discord.php

    r3071651 r3096662  
    1111 * Plugin URI:        https://www.expresstechsoftwares.com/learndash-and-discord-integration
    1212 * Description:       Connect LearnDash with Discord and open an oppurtunity of creating a vibrating community of your course learners.
    13  * Version:           1.0.13
     13 * Version:           1.0.14
    1414 * Author:            ExpressTech Softwares Solutions Pvt Ltd
    1515 * Author URI:        https://www.expresstechsoftwares.com
     
    2828 * Currently plugin version.
    2929 */
    30 define( 'LEARNDASH_DISCORD_VERSION', '1.0.13' );
     30define( 'LEARNDASH_DISCORD_VERSION', '1.0.14' );
    3131
    3232/**
  • connect-learndash-and-discord/trunk/public/class-learndash-discord-public.php

    r2902082 r3096662  
    206206        $enrolled_courses                                 = ets_learndash_discord_get_student_courses_id( $user_id );
    207207        $mapped_role_name                                 = '';
     208        $final_roles                                      = array();
    208209        if ( is_array( $enrolled_courses ) && is_array( $all_roles ) && is_array( $ets_learndash_discord_role_mapping ) ) {
    209210            foreach ( $enrolled_courses as $key => $enrolled_course_id ) {
     211
    210212                if ( array_key_exists( 'learndash_course_id_' . $enrolled_course_id, $ets_learndash_discord_role_mapping ) ) {
    211213
    212214                    $mapped_role_id = $ets_learndash_discord_role_mapping[ 'learndash_course_id_' . $enrolled_course_id ];
    213 
    214                     if ( array_key_exists( $mapped_role_id, $all_roles ) ) {
     215                   
     216                    if ( array_key_exists( $mapped_role_id, $all_roles ) && ! in_array( $mapped_role_id, $final_roles ) ) {
    215217                        $mapped_role_name .= '<span> <i style="background-color:#' . dechex( $roles_color[ $mapped_role_id ] ) . '"></i>' . $all_roles[ $mapped_role_id ] . '</span>';
    216218                    }
     219                    array_push( $final_roles, $mapped_role_id );
    217220                }
    218221            }
Note: See TracChangeset for help on using the changeset viewer.