Making WordPress.org

Changeset 6051


Ignore:
Timestamp:
10/23/2017 10:14:32 PM (7 years ago)
Author:
SergeyBiryukov
Message:

Support Forums: Don't display an empty list item for plugin icon if there's no icon, e.g. because the plugin is closed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-plugin-directory-compat.php

    r5868 r6051  
    9494        }
    9595
     96        $icon       = '';
    9697        $plugin     = sprintf( '<a href="//wordpress.org/plugins/%s/">%s</a>', esc_attr( $this->slug() ), esc_html( $this->plugin->post_title ) );
    9798        $faq        = sprintf( '<a href="//wordpress.org/plugins/%s/faq/">%s</a>', esc_attr( $this->slug() ), __( 'Frequently Asked Questions', 'wporg-forums' ) );
     
    101102        $reviews    = sprintf( '<a href="%s">%s</a>', home_url( '/plugin/' . esc_attr( $this->slug() ) . '/reviews/' ), __( 'Reviews', 'wporg-forums' ) );
    102103        $create     = '';
     104
     105        if ( function_exists( 'wporg_get_plugin_icon' ) ) {
     106            $icon = wporg_get_plugin_icon( $this->slug, 128 );
     107        }
    103108
    104109        $create_label = '';
     
    117122        <div>
    118123            <ul>
    119                 <?php if ( function_exists( 'wporg_get_plugin_icon' ) ) : ?>
    120                 <li><?php echo wporg_get_plugin_icon( $this->slug, 128 ); ?></li>
     124                <?php if ( $icon ) : ?>
     125                <li><?php echo $icon; ?></li>
    121126                <?php endif; ?>
    122127                <li style="clear:both;"><?php echo $plugin; ?></li>
Note: See TracChangeset for help on using the changeset viewer.