Making WordPress.org

Changeset 4549


Ignore:
Timestamp:
12/16/2016 06:54:45 PM (9 years ago)
Author:
coreymckrill
Message:

Mentor Dashboard: Fix unmentored camp count

Location:
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/mentors/dashboard.php

    r4548 r4549  
    138138
    139139/**
     140 * Count the total number of camps without mentors, with and without a start date.
     141 *
     142 * @param array $unmentored_camps
     143 *
     144 * @return int
     145 */
     146function count_camps_without_mentors( $unmentored_camps ) {
     147    $camps = 0;
     148
     149    if ( isset( $unmentored_camps['yesdate'] ) ) {
     150        $camps += count( $unmentored_camps['yesdate'] );
     151    }
     152
     153    if ( isset( $unmentored_camps['nodate'] ) ) {
     154        $camps += count( $unmentored_camps['nodate'] );
     155    }
     156
     157    return $camps;
     158}
     159
     160/**
    140161 * Get active camps that haven't been assigned a mentor
    141162 *
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/views/mentors/dashboard.php

    r4545 r4549  
    1515        <li>Number of mentors:             <strong><?php echo count( $mentors ); ?></strong></li>
    1616        <li>Active camps being mentored:   <strong><?php echo absint( count_camps_being_mentored( $mentors ) ); ?></strong></li>
    17         <li>Active camps without a mentor: <strong><?php echo count( $unmentored_camps ); ?></strong></li>
     17        <li>Active camps without a mentor: <strong><?php echo absint( count_camps_without_mentors( $unmentored_camps ) ); ?></strong></li>
    1818    </ul>
    1919
Note: See TracChangeset for help on using the changeset viewer.