Making WordPress.org

Changeset 2089


Ignore:
Timestamp:
11/18/2015 03:17:55 PM (9 years ago)
Author:
ocean90
Message:

Translate: Check if wporg_get_plugin_icon() exists before using it.

Fall back to a dashicon if the function doesn't exist.

Props akirk.
Fixes #1400.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/translate.wordpress.org/includes/gp-plugins/wporg-routes/routes/wp-plugins.php

    r2074 r2089  
    8181        } );
    8282
    83         $project->icon = wporg_get_plugin_icon( $project->slug, 64 );
     83        if ( function_exists( 'wporg_get_plugin_icon' ) ) {
     84            $project->icon = wporg_get_plugin_icon( $project->slug, 64 );
     85        } else {
     86            $project->icon = '<div class="default-icon"><span class="dashicons dashicons-admin-plugins"></span></div>';
     87        }
    8488
    8589        $this->tmpl( 'projects-wp-plugins', get_defined_vars() );
Note: See TracChangeset for help on using the changeset viewer.