WordPress.org

Making WordPress.org


Ignore:
Timestamp:
11/16/2017 06:04:41 PM (3 years ago)
Author:
ocean90
Message:

Main: Simplify release_row().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-main/inc/template-tags.php

    r6098 r6135  
    1212 *
    1313 * @param array  $release
    14  * @param string $alt_class
    15  * @param string $first_of_branch_class
    16  * @param bool   $reset
    1714 */
    18 function release_row( $release, $alt_class = '', $first_of_branch_class = '', $reset = false ) {
    19     static $even = true;
    20     static $last_branch = '';
    21 
    22     if ( $reset ) {
    23         $even        = true;
    24         $last_branch = '';
    25 
    26         return;
    27     }
    28 
    29     $classes = array();
    30     if ( ! $even && $alt_class ) {
    31         $classes[] = $alt_class;
    32     }
    33 
    34     $even = ! $even;
    35 
    36     if ( $release['branch'] != $last_branch && $first_of_branch_class ) {
    37         $classes[] = $first_of_branch_class;
    38     }
    39 
    40     $last_branch = $release['branch'];
     15function release_row( $release) {
    4116    ?>
    42 
    43     <tr class="<?php echo esc_attr( implode( ' ', $classes ) ); ?>">
     17    <tr>
    4418        <td><?php echo esc_html( $release['version'] ); ?></td>
    4519        <td><?php echo esc_html( date_i18n( get_option( 'date_format' ), $release['builton'] ) ); ?></td>
Note: See TracChangeset for help on using the changeset viewer.