Sarah Moyer

WordPress Development for Web Agencies

  • Home
  • Work with Me
    • for Agencies
    • for Designers
    • for Business Owners
    • FAQs
    • Website Care
  • Portfolio
  • Blog
  • Contact

Fix each() deprecated PHP function in WordPress

Last updated on November 21, 2019 · Posted in Snippets · errors

From this: while($dir=each($handle)) {

to this: foreach($handle as $dir) {

Warning: Please note that if your plugin or theme is by a third-party who has updates, any updates will remove your fixes. Please notify the plugin author or theme author rather than making these changes yourself.

See also:

  • Fix PHP error “Methods with same name as their class will not be constructors”
  • Fix create_function() deprecated PHP function in WordPress
  • Fix PHP error “called constructor method for WP_Widget… deprecated”

Was this post helpful?

Trackbacks

  1. Fix PHP error "Methods with same name as their class will not be constructors" - Sarah Moyer says:
    May 8, 2019 at 3:03 pm

    […] Fix each() deprecated PHP function in WordPress […]

    Reply
  2. Fix create_function() deprecated PHP function in WordPress - Sarah Moyer says:
    November 21, 2019 at 10:08 am

    […] Fix each() deprecated PHP function in WordPress […]

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Anti-Spam by WP-SpamShield

Recommended Resources

Copyright © 2023 by Sarah Moyer · Privacy Policy