Making WordPress.org


Ignore:
Timestamp:
02/18/2017 02:57:05 AM (8 years ago)
Author:
SergeyBiryukov
Message:

Support Forums: Check if wporg_get_plugin_icon() exists before calling it.

File:
1 edited

Legend:

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

    r4915 r4916  
    9393
    9494    public function do_topic_sidebar() {
    95         include_once WPORGPATH . 'extend/plugins-plugins/_plugin-icons.php';
     95        if ( file_exists( WPORGPATH . 'extend/plugins-plugins/_plugin-icons.php' ) ) {
     96            include_once WPORGPATH . 'extend/plugins-plugins/_plugin-icons.php';
     97        }
     98
    9699        $plugin  = sprintf( '<a href="//wordpress.org/plugins/%s/">%s</a>', esc_attr( $this->slug() ), esc_html( $this->plugin->post_title ) );
    97100        $faq     = sprintf( '<a href="//wordpress.org/plugins/%s/faq/">%s</a>', esc_attr( $this->slug() ), __( 'Frequently Asked Questions', 'wporg-forums' ) );
     
    117120            <h3><?php _e( 'About this Plugin', 'wporg-forums' ); ?></h3>
    118121            <ul>
     122                <?php if ( function_exists( 'wporg_get_plugin_icon' ) ) : ?>
    119123                <li><?php echo wporg_get_plugin_icon( $this->slug, 128 ); ?></li>
     124                <?php endif; ?>
    120125                <li style="clear:both;"><?php echo $plugin; ?></li>
    121126                <?php if ( ! empty( $this->plugin->post_content ) && false !== strpos( $this->plugin->post_content, '<!--section=faq-->' ) ) : ?>
Note: See TracChangeset for help on using the changeset viewer.