Title: Deprecated constructor
Last modified: March 12, 2018

---

# Deprecated constructor

 *  [Marco Chiesi](https://wordpress.org/support/users/marcochiesi/)
 * (@marcochiesi)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/deprecated-constructor-14/)
 * Hi there,
 * I believe the code needs a refresh in order to work smoothly with latest versions
   of PHP. See error below on PHP 7.
 * `Deprecated: Methods with the same name as their class will not be constructors
   in a future version of PHP; JQueryColorboxFrontend has a deprecated constructor
   in /[...]/wp-content/plugins/jquery-colorbox/includes/jquery-colorbox-frontend.
   php on line 11`
 * I’d be happy to provide a pull request if the project was hosted on GitHub.

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

 *  [bigfuzz](https://wordpress.org/support/users/bigfuzz/)
 * (@bigfuzz)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/deprecated-constructor-14/#post-10131474)
 * Did you find a resolution for this?
 *  Thread Starter [Marco Chiesi](https://wordpress.org/support/users/marcochiesi/)
 * (@marcochiesi)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/deprecated-constructor-14/#post-10131503)
 * The solution would be quite simple. It’s sufficient to change the name of the
   constructors from having the same name of the class to the newest PHP standard`
   __construct(...)`.
 * I.e.
 * From:
    `function JQueryColorboxFrontend($colorboxSettings) {`
 * To:
    `function __construct($colorboxSettings) {`
 * This needs to be done for all classes.
 *  [Stefano](https://wordpress.org/support/users/ste_95/)
 * (@ste_95)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/deprecated-constructor-14/#post-10654280)
 * Same goes for `JQueryColorboxFrontend`.
 *  [mywebmaestro](https://wordpress.org/support/users/mywebmaestro/)
 * (@mywebmaestro)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/deprecated-constructor-14/#post-11233418)
 * Will this be updated in the plugin? I’ve got the current version and am seeing
   the error on my website.
 * Deprecated: Methods with the same name as their class will not be constructors
   in a future version of PHP; JQueryColorboxFrontend has a deprecated constructor
   in /home/…/public_html/wp-content/plugins/jquery-colorbox/includes/jquery-colorbox-
   frontend.php on line 11

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

The topic ‘Deprecated constructor’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/jquery-colorbox_848c98.svg)
 * [jQuery Colorbox](https://wordpress.org/plugins/jquery-colorbox/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/jquery-colorbox/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/jquery-colorbox/)
 * [Active Topics](https://wordpress.org/support/plugin/jquery-colorbox/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/jquery-colorbox/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/jquery-colorbox/reviews/)

 * 4 replies
 * 4 participants
 * Last reply from: [mywebmaestro](https://wordpress.org/support/users/mywebmaestro/)
 * Last activity: [7 years, 3 months ago](https://wordpress.org/support/topic/deprecated-constructor-14/#post-11233418)
 * Status: not resolved