You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Intelephense currently does not recognize functions from WordPress plugins like WooCommerce unless the plugin source code is explicitly added to intelephense.environment.includePaths.
This causes issues in typical WordPress projects where:
WooCommerce (or another plugin) is installed in wp-content/plugins/
A theme or custom plugin uses common functions like wc_get_order() or wc_price()
Intelephense reports "undefined function" errors, despite the plugin being present in the workspace
Problem
WordPress plugins define functions in included files, often conditionally, and not via autoloading.
Intelephense doesn't follow WordPress’s loading logic, so these functions are skipped during indexing unless their paths are manually added.
This leads to missing definitions, broken autocomplete, and false-positive errors.
On systems with multiple projects (e.g., WSL on Windows), maintaining separate includePaths for each workspace is not scalable.
Proposal
Improve WordPress compatibility by indexing plugin code from known standard paths when a WordPress install is detected:
Detect WordPress projects by checking for wp-config.php in the workspace.
Automatically index:
wp-content/plugins/**
wp-content/mu-plugins/**
Allow this behavior to be toggled via a setting, e.g.:
"intelephense.indexWordPressPlugins": true
This would eliminate the need for per-project manual configuration in common environments.
This change would improve support for real-world WordPress development and reduce unnecessary configuration overhead.
The text was updated successfully, but these errors were encountered:
If you have a set of wp plugins that you frequently use for many projects couldn't you use the vscode user settings to avoid per project configuration?
Uh oh!
There was an error while loading. Please reload this page.
Intelephense currently does not recognize functions from WordPress plugins like WooCommerce unless the plugin source code is explicitly added to
intelephense.environment.includePaths
.This causes issues in typical WordPress projects where:
wp-content/plugins/
wc_get_order()
orwc_price()
Problem
includePaths
for each workspace is not scalable.Proposal
Improve WordPress compatibility by indexing plugin code from known standard paths when a WordPress install is detected:
wp-config.php
in the workspace.wp-content/plugins/**
wp-content/mu-plugins/**
This would eliminate the need for per-project manual configuration in common environments.
This change would improve support for real-world WordPress development and reduce unnecessary configuration overhead.
The text was updated successfully, but these errors were encountered: