Title: Problem with PHP 7.4
Last modified: March 20, 2020

---

# Problem with PHP 7.4

 *  Resolved [Miguel Useche](https://wordpress.org/support/users/skatox/)
 * (@skatox)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/problem-with-php-7-4/)
 * There’s a problem with PHP 7.4, it throws a notice because If I don’t mark all
   option, it won’t be such information in the database, but then when checking 
   it says that key doesn’t exists.
 * On **/admin/class-extended-post-status-admin.php** line 197, for each `if` check
   if array has they key, otherwise it will throw the notice.

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

 *  Plugin Author [Felix W.](https://wordpress.org/support/users/welly2103/)
 * (@welly2103)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/problem-with-php-7-4/#post-12573308)
 * Hi [@skatox](https://wordpress.org/support/users/skatox/)
 * thanks for the feedback. I’ll have a look at this and will come back to you.
 * Greetings Felix
 *  Plugin Author [Felix W.](https://wordpress.org/support/users/welly2103/)
 * (@welly2103)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/problem-with-php-7-4/#post-12574341)
 * Hi [@skatox](https://wordpress.org/support/users/skatox/)
 * I found some other issue while creating new statuses with the counting of posts
   and pages in the status overview page, but PHP 7.4 doen’t throw any notices belonging
   to the code part from line 183 to 214 as you said.
 *     ```
       public function register_post_status()
           {
               $status = self::get_status();
               foreach ($status as $single_status) {
                   $term_meta = get_option("taxonomy_term_$single_status->term_id");
                   $args = [
                       'label' => $single_status->name,
                       'label_count' => _n_noop($single_status->name . ' <span class="count">(%s)</span>', $single_status->name . ' <span class="count">(%s)</span>'),
                   ];
                   if ($term_meta['public'] == 1) {
                       $args['public'] = true;
                   } else {
                       $args['public'] = false;
                   }
                   if ($term_meta['show_in_admin_all_list'] == 1) {
                       $args['show_in_admin_all_list'] = true;
                   } else {
                       $args['show_in_admin_all_list'] = false;
                   }
                   if ($term_meta['show_in_admin_status_list'] == 1) {
                       $args['show_in_admin_status_list'] = true;
                   } else {
                       $args['show_in_admin_status_list'] = false;
                   }
                   if ($term_meta['hide_in_drop_down'] == 1) {
                       $args['hide_in_drop_down'] = true;
                   } else {
                       $args['hide_in_drop_down'] = false;
                   }
                   register_post_status($single_status->slug, $args);
               }
           }
       ```
   
 * It makes sense, that the $term_meta variable may not contain the needed information
   and that I have to check this beforehand, but I can not reproduce the notice 
   in PHP. Is there anything I should add extra, to provoke this notice?
 * I just used the current WP version 5.3.2 as a blank setup and installed the plugin.
 * Thanks for your help.
 * Greetings Felix
 *  Thread Starter [Miguel Useche](https://wordpress.org/support/users/skatox/)
 * (@skatox)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/problem-with-php-7-4/#post-12574631)
 * Thanks for the quick reply. I reproduced it on my local server and my customer’s
   server. I believe both are configured to show PHP Notices by default.
 * Here you can see how to enable it:
    [https://www.php.net/manual/en/function.error-reporting.php](https://www.php.net/manual/en/function.error-reporting.php)
 * I have E_NOTICE_ALL added to show this kind of errors.
 * Btw, nice plugin 🙂 I tried to do a button on gutenberg to quickly set a button
   to an specific state. It would be great to have that in the future. The box is
   ok but my client found it to complex to set status on the dropdown and the click
   on save draft.
 *  [oldcrazypirate](https://wordpress.org/support/users/oldcrazypirate/)
 * (@oldcrazypirate)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/problem-with-php-7-4/#post-12592491)
 * Hi,
 * Does this bug also applies to PHP version 7.2 or only 7.4?
 *  Plugin Author [Felix W.](https://wordpress.org/support/users/welly2103/)
 * (@welly2103)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/problem-with-php-7-4/#post-12592538)
 * Hey guys,
 * sorry I had a stressful week. I just wanted to let you know that I’m still investigating
   the problem. I’m looking forward to fix this on the weekend. Cause of the corona
   quarantine situation here in Germany I’ll have some more time looking at this
   problem ;D
 * [@oldcrazypirate](https://wordpress.org/support/users/oldcrazypirate/) as of 
   today I’m not aware of the bug at all, but [@skatox](https://wordpress.org/support/users/skatox/)
   seems to have the error explicit on 7.4. As soon as I’m able to reproduce this,
   I’ll test it with 7.2, 7.3 and 7.4.
 * Greeting Felix
 *  Plugin Author [Felix W.](https://wordpress.org/support/users/welly2103/)
 * (@welly2103)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/problem-with-php-7-4/#post-12633457)
 * Hi [@skatox](https://wordpress.org/support/users/skatox/)
 * have you quick fixed your code already? This should work, right?
    Can you validate
   this?
 *     ```
       public function register_post_status()
           {
               $status = self::get_status();
               foreach ($status as $single_status) {
                   $term_meta = get_option("taxonomy_term_$single_status->term_id");
                   $args = [
                       'label' => $single_status->name,
                       'label_count' => _n_noop($single_status->name . ' <span class="count">(%s)</span>', $single_status->name . ' <span class="count">(%s)</span>'),
                   ];
                   if (array_key_exists('public', $term_meta) && $term_meta['public'] == 1) {
                       $args['public'] = true;
                   } else {
                       $args['public'] = false;
                   }
                   if (array_key_exists('show_in_admin_all_list', $term_meta) && $term_meta['show_in_admin_all_list'] == 1) {
                       $args['show_in_admin_all_list'] = true;
                   } else {
                       $args['show_in_admin_all_list'] = false;
                   }
                   if (array_key_exists('show_in_admin_status_list', $term_meta) && $term_meta['show_in_admin_status_list'] == 1) {
                       $args['show_in_admin_status_list'] = true;
                   } else {
                       $args['show_in_admin_status_list'] = false;
                   }
                   if (array_key_exists('hide_in_drop_down', $term_meta) && $term_meta['hide_in_drop_down'] == 1) {
                       $args['hide_in_drop_down'] = true;
                   } else {
                       $args['hide_in_drop_down'] = false;
                   }
                   register_post_status($single_status->slug, $args);
               }
           }
       ```
   
 * Thank you and have a great start into this week!
 * Greetings Felix
 *  Plugin Author [Felix W.](https://wordpress.org/support/users/welly2103/)
 * (@welly2103)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/problem-with-php-7-4/#post-12737240)
 * Hi [@skatox](https://wordpress.org/support/users/skatox/)
 * I published this fix with version 1.0.12
 * Greetings Felix
 *  Thread Starter [Miguel Useche](https://wordpress.org/support/users/skatox/)
 * (@skatox)
 * [6 years ago](https://wordpress.org/support/topic/problem-with-php-7-4/#post-12774908)
 * Thanks! I noticed the update and seems to be fixed 🙂

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

The topic ‘Problem with PHP 7.4’ is closed to new replies.

 * ![](https://ps.w.org/extended-post-status/assets/icon-256x256.png?rev=1981802)
 * [Extended Post Status](https://wordpress.org/plugins/extended-post-status/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/extended-post-status/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/extended-post-status/)
 * [Active Topics](https://wordpress.org/support/plugin/extended-post-status/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/extended-post-status/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/extended-post-status/reviews/)

 * 8 replies
 * 3 participants
 * Last reply from: [Miguel Useche](https://wordpress.org/support/users/skatox/)
 * Last activity: [6 years ago](https://wordpress.org/support/topic/problem-with-php-7-4/#post-12774908)
 * Status: resolved