PHPStorm and WordPress project errors

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.

Read More

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?

Related posts

Leave a Reply

1 comment

  1. You need to reference WordPress code in some way. Few possible approaches:

    1. Add as External Library — perfect for referencing only: Settings | PHP | Include paths
    2. 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
    3. Symbolic link somewhere in the project (but #2 is still better for your case)