PHPStorm and WordPress project errors
phpstorm, syntax-error, wordpress
Solution
You need to reference WordPress code in some way. Few possible approaches:
- Add as External Library -- perfect for referencing only: `Settings | PHP | Include paths`
- Add as part of the project itself (careful, as in this case WP code will be used during Search/Refactor/etc operations) -- `Settings | Directories | Add Content Root`
- Symbolic link somewhere in the project (but #2 is still better for your case)
Problem
I'm using `PHPStorm` while develop `WordPress` plugins (mainly for HTML/CSS/JS). Each plugin is a separate `PHPStorm` project since I can have several goodies from using this way. The issue is when working on a plugin, the `WordPress` functions like `_e` are marked as `Warnings` (yellow color) and the information `PHPStorm` gives is that ``` "Undefined function _e" ``` How can I configure `PHPStorm` that it understand the `WordPress` functions and do not shows that errors and autocomplete the functions without to have a big project wrapping the `WordPress` installation?