Title: Reference to $this in static method
Last modified: May 18, 2018

---

# Reference to $this in static method

 *  Resolved [Aurovrata Venet](https://wordpress.org/support/users/aurovrata/)
 * (@aurovrata)
 * [8 years ago](https://wordpress.org/support/topic/reference-to-this-in-static-method/)
 * Dear David
 * greetings from south India, hope you’re well!
 * I came across the following line of code, a reference to `$this` in a static 
   method, file /includes/class-mla-settings-documentation-tab.php, line 1000,
 * `return new WP_Error( 'remove_old_failed', $this->strings['remove_old_failed']);`
 * kind regards
 * Vrata

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

 *  Plugin Author [David Lingren](https://wordpress.org/support/users/dglingren/)
 * (@dglingren)
 * [8 years ago](https://wordpress.org/support/topic/reference-to-this-in-static-method/#post-10305163)
 * Thank you for your report and for the specifics about the code; very helpful.
 * I am traveling and away from my development system for a few more days but I 
   will investigate further when I return home. I will post an update here when 
   I have progress to report.
 *  Plugin Author [David Lingren](https://wordpress.org/support/users/dglingren/)
 * (@dglingren)
 * [7 years, 12 months ago](https://wordpress.org/support/topic/reference-to-this-in-static-method/#post-10321227)
 * I have found and removed the line of code you referred to. It was unreachable
   because the line just above it is a “return” statement, so it cannot cause any
   trouble. I will release the fix in my next MLA version.
 * I am marking this topic resolved. Thanks again for alerting me to this issue.
 *  Thread Starter [Aurovrata Venet](https://wordpress.org/support/users/aurovrata/)
 * (@aurovrata)
 * [7 years, 12 months ago](https://wordpress.org/support/topic/reference-to-this-in-static-method/#post-10321489)
 * you’re wc David, thanks for a great plugin 🙂
 * It was my code editor that popped up the warning, it never caused any run-time
   errors as such, but I felt it was good to clean it up.
 * have a nice day!

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

The topic ‘Reference to $this in static method’ is closed to new replies.

 * ![](https://ps.w.org/media-library-assistant/assets/icon-256x256.png?rev=973502)
 * [Media Library Assistant](https://wordpress.org/plugins/media-library-assistant/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/media-library-assistant/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/media-library-assistant/)
 * [Active Topics](https://wordpress.org/support/plugin/media-library-assistant/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/media-library-assistant/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/media-library-assistant/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Aurovrata Venet](https://wordpress.org/support/users/aurovrata/)
 * Last activity: [7 years, 12 months ago](https://wordpress.org/support/topic/reference-to-this-in-static-method/#post-10321489)
 * Status: resolved