Skip to content

Instantly share code, notes, and snippets.

@arfinmilondev
Created August 7, 2024 06:23
Show Gist options
  • Select an option

  • Save arfinmilondev/c6b610f1b8175cf7e4c9df92edb74870 to your computer and use it in GitHub Desktop.

Select an option

Save arfinmilondev/c6b610f1b8175cf7e4c9df92edb74870 to your computer and use it in GitHub Desktop.
Access array offset on value of null Issue Fixing
<?php
$feature_image = '';
if (($settings['feature_icon_type'] ?? '') == 'img') {
$feature_image = Group_Control_Image_Size::get_attachment_image_html($settings, 'feature_imagesize', 'feature_image');
}
$html_output = '';
$html_output .= '<div ' . $this->get_render_attribute_string('growth_feature_attr') . ' >';
if (!empty($feature_image)) {
$html_output .= '<div class="feature-icon">' . $feature_image . '</div>';
} elseif ($settings['feature_icon_type'] == 'icon' and !empty($settings['feature_icon'])) {
$html_output .= '<div class="feature-icon"><i class="' . esc_attr($settings['feature_icon']) . '"></i></div>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment