Making WordPress.org

Ticket #3503: 3503.patch

File 3503.patch, 2.1 KB (added by ocean90, 7 years ago)
  • trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-plugin-directory-compat.php

     
    7373                $plugin = $this->get_object( $slug );
    7474                if ( ! $plugin ) {
    7575                        return;
    76                 } else {
    77                         $this->slug         = $slug;
    78                         $this->plugin       = $plugin;
    79                         $this->authors      = $this->get_authors( $slug );
    80                         $this->contributors = $this->get_contributors( $slug );
    81                         $this->support_reps = $this->get_support_reps( $slug );
    8276                }
     77
     78                $this->slug         = $slug;
     79                $this->plugin       = $plugin;
     80                $this->authors      = $this->get_authors( $slug );
     81                $this->contributors = $this->get_contributors( $slug );
     82                $this->support_reps = $this->get_support_reps( $slug );
    8383        }
    8484
    8585        public function do_view_sidebar() {
     
    8989        }
    9090
    9191        public function do_topic_sidebar() {
    92                 if ( file_exists( WPORGPATH . 'extend/plugins-plugins/_plugin-icons.php' ) ) {
    93                         include_once WPORGPATH . 'extend/plugins-plugins/_plugin-icons.php';
     92                if ( file_exists( WPORGPATH . 'wp-content/plugins/plugin-directory/class-template.php' ) ) {
     93                        include_once WPORGPATH . 'wp-content/plugins/plugin-directory/class-template.php';
    9494                }
    9595
    9696                $icon       = '';
     
    102102                $reviews    = sprintf( '<a href="%s">%s</a>', home_url( '/plugin/' . esc_attr( $this->slug() ) . '/reviews/' ), __( 'Reviews', 'wporg-forums' ) );
    103103                $create     = '';
    104104
    105                 if ( function_exists( 'wporg_get_plugin_icon' ) ) {
    106                         $icon = wporg_get_plugin_icon( $this->slug, 128 );
     105                if ( defined( 'WPORG_PLUGIN_DIRECTORY_BLOGID' ) && class_exists( '\WordPressdotorg\Plugin_Directory\Template' ) ) {
     106                        switch_to_blog( WPORG_PLUGIN_DIRECTORY_BLOGID );
     107                        $icon = \WordPressdotorg\Plugin_Directory\Template::get_plugin_icon( $this->plugin, 'html' );
     108                        restore_current_blog();
    107109                }
    108110
    109111                $create_label = '';