Making WordPress.org

Changeset 14954


Ignore:
Timestamp:
06/08/2026 07:52:12 PM (6 days ago)
Author:
bor0
Message:

jobs.wordpress.net: adapt to simplified open-to-work REST response

Use current_role and current_company directly instead of indexing into
the positions array. Apply the #OPENTOWORK ring only to candidates with
show_badge set, via a conditional has-badge class on the avatar.

Refs: https://github.com/WordPress/wordpress.org/issues/672

Location:
sites/trunk/jobs.wordpress.net/public_html/wp-content/themes/jobswp
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/jobs.wordpress.net/public_html/wp-content/themes/jobswp/content-home.php

    r14953 r14954  
    193193            <?php foreach ( $paged_candidates as $candidate ) : ?>
    194194                <?php
    195                 $current_role    = '';
    196                 $current_company = '';
    197 
    198                 if ( ! empty( $candidate->positions ) ) {
    199                     $latest          = $candidate->positions[0];
    200                     $current_role    = isset( $latest->role ) ? $latest->role : '';
    201                     $current_company = isset( $latest->company ) ? $latest->company : '';
    202                 }
     195                $current_role    = isset( $candidate->current_role )    ? $candidate->current_role    : '';
     196                $current_company = isset( $candidate->current_company ) ? $candidate->current_company : '';
    203197                ?>
    204198                <a href="<?php echo esc_url( $candidate->profile_url ); ?>" class="candidate-card" target="_blank" rel="noopener noreferrer">
    205                     <div class="candidate-card__avatar">
     199                    <div class="candidate-card__avatar<?php echo ! empty( $candidate->show_badge ) ? ' has-badge' : ''; ?>">
    206200                        <img src="<?php echo esc_url( 'https://wordpress.org/grav-redirect.php?user=' . urlencode( $candidate->user_login ) . '&s=80' ); ?>" alt="" width="80" height="80" loading="lazy">
    207201                    </div>
  • sites/trunk/jobs.wordpress.net/public_html/wp-content/themes/jobswp/content-single.php

    r14953 r14954  
    133133            <?php foreach ( $single_candidates as $person ) : ?>
    134134                <?php
    135                 $role    = ! empty( $person->positions[0]->role ) ? $person->positions[0]->role : '';
    136                 $company = ! empty( $person->positions[0]->company ) ? $person->positions[0]->company : '';
     135                $role    = isset( $person->current_role )    ? $person->current_role    : '';
     136                $company = isset( $person->current_company ) ? $person->current_company : '';
    137137                ?>
    138138                <a href="<?php echo esc_url( $person->profile_url ); ?>" class="candidate-card candidate-card--compact" target="_blank" rel="noopener noreferrer">
    139                     <div class="candidate-card__avatar">
     139                    <div class="candidate-card__avatar<?php echo ! empty( $person->show_badge ) ? ' has-badge' : ''; ?>">
    140140                        <img src="<?php echo esc_url( 'https://wordpress.org/grav-redirect.php?user=' . urlencode( $person->user_login ) . '&s=64' ); ?>" alt="" width="64" height="64" loading="lazy">
    141141                    </div>
  • sites/trunk/jobs.wordpress.net/public_html/wp-content/themes/jobswp/style.css

    r14953 r14954  
    14771477}
    14781478
    1479 .candidate-card__avatar::after {
     1479.candidate-card__avatar.has-badge::after {
    14801480    content: "";
    14811481    position: absolute;
Note: See TracChangeset for help on using the changeset viewer.