Support » Themes and Templates » P2 » Notice PHP4 style class constructors

  • As a plugin developer, I’m always using WP_DEBUG = true. This shows notices for P2 having PHP4 style class constructors (mostly in widgets). I’m using the latest version of the theme. Could this be fixed?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Kathryn

    (@zoonini)


    Automattic Happiness Engineer


    Hi there. Are you able to provide a specific file and line number where you’re seeing an older-style constructor being used? The theme was updated to use the __construct format as of v. 1.5.7, so if we missed some it’d be helpful to know where, if you don’t mind. Thanks!

    Ha, I stand corrected, it’s not in widgets but in other basic functional classes. Here is the complete list of notices (running version 1.5.8):

    
    Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; P2 has a deprecated constructor in C:\xampp\htdocs\dev\wordpress-develop\src\wp-content\themes\p2\functions.php on line 13
    
    Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; P2_Terms_In_Comments has a deprecated constructor in C:\xampp\htdocs\dev\wordpress-develop\src\wp-content\themes\p2\inc\terms-in-comments.php on line 9
    
    Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; P2_Mentions has a deprecated constructor in C:\xampp\htdocs\dev\wordpress-develop\src\wp-content\themes\p2\inc\mentions.php on line 16
    
    Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; P2_Search has a deprecated constructor in C:\xampp\htdocs\dev\wordpress-develop\src\wp-content\themes\p2\inc\search.php on line 9
    
    Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; P2_Post_List_Creator has a deprecated constructor in C:\xampp\htdocs\dev\wordpress-develop\src\wp-content\themes\p2\inc\list-creator.php on line 37
    
    Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; P2_Comment_List_Creator has a deprecated constructor in C:\xampp\htdocs\dev\wordpress-develop\src\wp-content\themes\p2\inc\list-creator.php on line 181
    
    Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; P2_List_Creator has a deprecated constructor in C:\xampp\htdocs\dev\wordpress-develop\src\wp-content\themes\p2\inc\list-creator.php on line 347
    
    

    Thank you for looking into this!

    Moderator Kathryn

    (@zoonini)


    Automattic Happiness Engineer


    Thanks for that! I’ll pass it on to our developers.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.