I literally got used to Visual Studio code highlighting function names from WordPress core when working in environments that don’t include the WordPress Core files. Quite disturbing actually – especially when you have code sniffers setup and follow WordPress Coding Standards.
Well, today I noticed it again and did some research. Apparently, there’s an easy fix!
The Easy Fix
When you have PHP Intelephense installed (and if you don’t have it, go get it), this is what you need to:
- Go to Preferences -> Settings
- Open Extensions -> Intelephense
- Scroll all the way down to “Subs” (it’s a large list, can’t miss it)
- Click “Add Item”
- Press “W” for WordPress, or scroll down the list untill you find it.
- Select WordPress and click “OK”
- Close your settings
That’s it!
Happy developing!
Leave a Reply