Skip to content

Commit

Permalink
fix PHP warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
remyperona committed Aug 14, 2023
1 parent 0230010 commit d710235
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Plugin_Card_Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,13 @@ public function get_description() {
* @return string The plugin icon as a img tag.
*/
public function get_icon() {
$pi = ( ! is_wp_error( $this->plugin_information ) && isset( $this->plugin_information->icons ) ) ? '<img src="' . $this->plugin_information->icons['2x'] . '"/>' : '';
return ( ! is_null( $this->params['icon'] ) ) ? $this->params['icon'] : $pi;
$plugin_info = '';

if ( ! is_wp_error( $this->plugin_information ) && isset( $this->plugin_information->icons['2x'] ) ) {
$plugin_info = '<img src="' . $this->plugin_information->icons['2x'] . '"/>';
}

return ( ! is_null( $this->params['icon'] ) ) ? $this->params['icon'] : $plugin_info;
}

/**
Expand Down

0 comments on commit d710235

Please sign in to comment.