Title: PHP Warning: Undefined array key &#8220;label&#8221; &#8230;
Last modified: February 16, 2023

---

# PHP Warning: Undefined array key “label” …

 *  Resolved [Ov3rfly](https://wordpress.org/support/users/ov3rfly/)
 * (@ov3rfly)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-label/)
 * Menu Icons 0.13.2 and WordPress 6.1.1 causes many of these entries in error log
   on a client website:
 *     ```wp-block-code
       PHP Warning:  Undefined array key "label" in ../wp-admin/includes/media.php on line 1987
       ```
   
 * Problem is this in `vendor/codeinwp/themeisle-sdk/src/Modules/Promotions.php`
   at line 508 in a function _“Add promo to attachment modal”_ where no `label` 
   is defined.
 *     ```wp-block-code
       $fields['optimole'] = array(
       	'input' => 'html',
       	'html'  => '<div id="ti-optml-notice-helper"></div>',
       );
       ```
   
 * Fields added via `attachment_fields_to_edit` filter should contain a `label` –
   at least similar to this:
 *     ```wp-block-code
       $fields['optimole'] = array(
       	'input' => 'html',
       	'html'  => '<div id="ti-optml-notice-helper"></div>',
       	'label'  => ''
       );
       ```
   
 * Maybe similar issue as [described here](https://wordpress.org/support/topic/latest-version-0-13-2-kills-the-customizer/)(
   not sure why that issue is currently marked as resolved).
 * Feel free to mark this issue as resolved **after** a plugin update with a fix
   has been released, not before, thanks.

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Support [Stefan Cotitosu](https://wordpress.org/support/users/stefancotitosu/)
 * (@stefancotitosu)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-label/#post-16491494)
 * Hi [@ov3rfly](https://wordpress.org/support/users/ov3rfly/),
 * Thank you for using Menu Icons, and I’m sorry to hear about the difficulties 
   encountered.
 * I’ve tested the plugin on an instance with WordPress 6.1.1, PHP 8.1 and two themes
   Neve, and Twenty Twenty-One, and I can’t replicate the issue.
 * Would it be possible to share more details about the theme you are using and 
   the PHP version?
 * Regards,
   Stefan
 *  Thread Starter [Ov3rfly](https://wordpress.org/support/users/ov3rfly/)
 * (@ov3rfly)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-label/#post-16491902)
    - Install fresh WordPress 6.1.1, PHP 8.1, any theme
    - Activate `WP_DEBUG_LOG`
    - Install & activate Menu Icons 0.13.2
    - Upload image to Media Library or edit image in Media Library
    - Check `wp-content/debug.log` and find this:
 *     ```wp-block-code
       PHP Warning: Undefined array key "label" in ../wp-admin/includes/media.php on line 1983
       ```
   
 *  Thread Starter [Ov3rfly](https://wordpress.org/support/users/ov3rfly/)
 * (@ov3rfly)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-label/#post-16492814)
 * Found an additional issue with WordPress 6.1.1, PHP 8.1, Menu Icons 0.13.2
 *     ```wp-block-code
       PHP Deprecated:  Automatic conversion of false to array is deprecated in ../menu-icons/vendor/codeinwp/themeisle-sdk/src/Modules/Dashboard_widget.php on line 323
       ```
   
 * This happens if transient `themeisle_sdk_feed_items` is expired/not set, then
   variable `$items_normalized` is set to `false` but used later as array `$items_normalized[]
   = ...` for some feed items.
 *  Plugin Support [Vytis](https://wordpress.org/support/users/bvytis/)
 * (@bvytis)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-label/#post-16517365)
 * Hi [@ov3rfly](https://wordpress.org/support/users/ov3rfly/),
   Thanks for sharing
   more details. I followed all the steps you provided with mentioned version of
   plugin and PHP, WordPress but I don’t get same warnings in debug mode.I shared
   the information with our development team, I hope they will find something from
   the information provided.
 *  Thread Starter [Ov3rfly](https://wordpress.org/support/users/ov3rfly/)
 * (@ov3rfly)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-label/#post-16561803)
 * Issues could be 100% replicated as described above.
 * Your development team obviously was able to replicate and has fixed both.
 *  [luciamarinescu](https://wordpress.org/support/users/luciamarinescu/)
 * (@luciamarinescu)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-label/#post-16562615)
 * Hi [@ov3rfly](https://wordpress.org/support/users/ov3rfly/)!
 * The first issue you mentioned was already solved in a previous version of the
   plugin (0.13.3) and the second one was related to PHP 8.1 and it was fixed in
   the latest version.
 * Have a nice day!
 *  Thread Starter [Ov3rfly](https://wordpress.org/support/users/ov3rfly/)
 * (@ov3rfly)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-label/#post-16563564)
 * Issues had already been reported for Menu Icons 0.13.2.
 * Plugin support was unable to replicate issues despite clear instructions, no 
   feedback at all has been provided about the fixes and the fixes are not mentioned
   in [changelog](https://wordpress.org/plugins/menu-icons/#developers) for 0.13.3
   and 0.13.4.
 * Had to compare code myself and confirm fixes now here for other readers.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘PHP Warning: Undefined array key “label” …’ is closed to new replies.

 * ![](https://ps.w.org/menu-icons/assets/icon-128x128.png?rev=2526860)
 * [Menu Icons by Themeisle – Add Icons to Navigation Menus](https://wordpress.org/plugins/menu-icons/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/menu-icons/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/menu-icons/)
 * [Active Topics](https://wordpress.org/support/plugin/menu-icons/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/menu-icons/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/menu-icons/reviews/)

## Tags

 * [label](https://wordpress.org/support/topic-tag/label/)
 * [PHP Warning](https://wordpress.org/support/topic-tag/php-warning/)
 * [undefined](https://wordpress.org/support/topic-tag/undefined/)

 * 7 replies
 * 4 participants
 * Last reply from: [Ov3rfly](https://wordpress.org/support/users/ov3rfly/)
 * Last activity: [3 years, 2 months ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-label/#post-16563564)
 * Status: resolved