Title: PHP Warning: Undefined array key &#8220;value&#8221; in lib-widget-fields.php
Last modified: July 24, 2026

---

# PHP Warning: Undefined array key “value” in lib-widget-fields.php

 *  Resolved [Andrzej Klasén](https://wordpress.org/support/users/bibeldans/)
 * (@bibeldans)
 * [2 weeks ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-value-in-lib-widget-fields-php/)
 * **Title:** PHP Warning: Undefined array key “value” in `lib-widget-fields.php`(
   checkbox widget field)
 * **Plugin version:** 8.8.7
 * **Environment:**
    - PHP 8.3 (CloudLinux Alt-PHP)
    - WordPress (latest)
 * **Description:**
 * The `checkbox()` method in `includes/widgets/lib-widget-fields.php` (line 85)
   reads `$field['value']` directly without checking whether the key exists:
 * php
 *     ```wp-block-code
       protected static function checkbox( $id, $name, $value, $label, $options, $field ) {
           ?>
           <input type="checkbox" ... value="<?php echo esc_attr( $field['value'] ); ?>" <?php checked( $value, $field['value'] ); ?> />
       ```
   
 * However, several built-in widgets define checkbox-type fields **without** setting
   a `'value'` key, e.g.:
    - `includes/widgets/popular-listings.php`
    - `includes/widgets/submit-listing.php`
    - `includes/widgets/login-form.php`
    - `includes/widgets/featured-listing.php`
    - `includes/widgets/all-locations.php`
 * Whenever one of these widgets is rendered in the WordPress admin (widget editor/
   Customizer), it throws:
 *     ```wp-block-code
       PHP Warning: Undefined array key "value" in .../includes/widgets/lib-widget-fields.php on line 85
       ```
   
 * This occurred 40 times in our error log over roughly a week of normal admin usage.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fphp-warning-undefined-array-key-value-in-lib-widget-fields-php%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Plugin Support [Mahfuzul Alam](https://wordpress.org/support/users/mahfuz87/)
 * (@mahfuz87)
 * [1 week, 3 days ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-value-in-lib-widget-fields-php/#post-18976884)
 * Hello [@bibeldans](https://wordpress.org/support/users/bibeldans/)
 * Thank you for reaching out.
 * We have fixed this issue and included the fix in the latest version of Directorist.
 * Please update Directorist to the latest version and let us know your feedback.
   If the issue still persists after updating, please let us know, and we’ll be 
   happy to investigate further.
 * Thank you for your patience and cooperation.
 * Kind Regards

Viewing 1 replies (of 1 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fphp-warning-undefined-array-key-value-in-lib-widget-fields-php%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/directorist/assets/icon-256x256.gif?rev=3185058)
 * [Directorist: AI-Powered Business Directory, Listings & Classified Ads](https://wordpress.org/plugins/directorist/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/directorist/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/directorist/)
 * [Active Topics](https://wordpress.org/support/plugin/directorist/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/directorist/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/directorist/reviews/)

## Tags

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

 * 1 reply
 * 2 participants
 * Last reply from: [Mahfuzul Alam](https://wordpress.org/support/users/mahfuz87/)
 * Last activity: [1 week, 3 days ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-value-in-lib-widget-fields-php/#post-18976884)
 * Status: resolved