Plugin Directory

Changeset 3491142


Ignore:
Timestamp:
03/25/2026 06:03:50 PM (3 days ago)
Author:
davidfcarr
Message:

member profile block improvements

Location:
rsvpmaker-for-toastmasters
Files:
619 added
3 edited

Legend:

Unmodified
Added
Removed
  • rsvpmaker-for-toastmasters/trunk/readme.txt

    r3491116 r3491142  
    66Requires at least: 5.0
    77Tested up to: 7.0
    8 Stable tag: 6.6.7
     8Stable tag: 6.6.8
    99License: GPLv2
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • rsvpmaker-for-toastmasters/trunk/rsvpmaker-for-toastmasters.php

    r3491116 r3491142  
    99Text Domain: rsvpmaker-for-toastmasters
    1010Domain Path: /translations
    11 Version: 6.6.7
     11Version: 6.6.8
    1212License: GPLv2
    1313*/
  • rsvpmaker-for-toastmasters/trunk/utility.php

    r3491116 r3491142  
    459459        if ( is_array( $wp4toastmasters_officer_titles ) && is_array( $officer_ids )  && is_array( $slugs ) ) {
    460460            foreach($slugs as $index => $slug) {
     461                if(empty($slug) || empty($officer_ids[$index]) || empty($wp4toastmasters_officer_titles[$index]))
     462                    continue;
    461463                $officers[$slug] = array('title' => $wp4toastmasters_officer_titles[$index], 'id' => $officer_ids[$index]);
    462464            }
     
    37243726                printf('<div class="contactdetails"><label>%s:</label> %s</div>', esc_html($label), esc_html($profile[$key]));
    37253727        }
     3728    if(current_user_can('manage_options') && !empty($profile['title']))
     3729        {
     3730        printf('<div class="contactdetails">For the Administrator: <a href="%s">%s</a></div>',admin_url('options-general.php?page=wp4toastmasters_settings'), esc_html(__('Edit Officers List','rsvpmaker-for-toastmasters')));
     3731        }
    37263732    if($profile['ID'] == $current_user->ID )
    37273733        {
    37283734        printf('<div class="contactdetails">Your Data: <a href="%s">%s</a> | <a href="%s">%s</a></div>', admin_url('profile.php'), esc_html(__('Edit Profile','rsvpmaker-for-toastmasters')), admin_url('profile.php#simple-local-avatar-section'), esc_html(__('Edit Profile Picture','rsvpmaker-for-toastmasters')));
    37293735        }
    3730     elseif(current_user_can('manage_options') && !empty($profile['title']))
    3731         {
    3732         printf('<div class="contactdetails">For the Administrator: <a href="%s">%s</a> | <a href="%s">%s</a> | <a href="%s">%s</a></div>', admin_url('user-edit.php?user_id=' . $profile['ID']), esc_html(__('Edit Profile','rsvpmaker-for-toastmasters')), admin_url('user-edit.php?user_id=' . $profile['ID'] . '#simple-local-avatar-section'), esc_html(__('Edit Profile Picture','rsvpmaker-for-toastmasters')), admin_url('options-general.php?page=wp4toastmasters_settings'), esc_html(__('Edit Officers List','rsvpmaker-for-toastmasters')));
    3733         }
    3734     elseif(current_user_can('edit_users'))
     3736    elseif(current_user_can('edit_user', $profile['ID']) && !user_can($profile['ID'],'manage_options') )
    37353737        {
    37363738        printf('<div class="contactdetails">Based on Your Editing Rights: <a href="%s">%s</a> | <a href="%s">%s</a></div>', admin_url('user-edit.php?user_id=' . $profile['ID']), esc_html(__('Edit Profile','rsvpmaker-for-toastmasters')), admin_url('user-edit.php?user_id=' . $profile['ID'] . '#simple-local-avatar-section'), esc_html(__('Edit Profile Picture','rsvpmaker-for-toastmasters')));
     
    37903792        $response['list'] = [];
    37913793        $include = [];
     3794        $officer_ids = [];
    37923795            foreach($officers as $key => $data) {
     3796                if(in_array($data['id'], $officer_ids)) {
     3797                    $index = array_search($data['id'], $officer_ids);
     3798                    $titles[$index] .= ', ' . $data['title'];
     3799                    continue;
     3800                }
    37933801                $officer_ids[] = $data['id'];
    37943802                $titles[] = $data['title'];
     
    38033811                $profile = wpt_public_profile($data->ID ?? 0,$response['map'],$attributes, true);
    38043812                if($profile) {
    3805                     $profile['title'] = $officers_by_id[$data->ID] ?? '';
     3813                    $profile['title'] = $titles[$index];
    38063814                }
    38073815            }
Note: See TracChangeset for help on using the changeset viewer.