-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Closed
Labels
coreAnything pertaining to core functionality of the application (opencode server stuff)Anything pertaining to core functionality of the application (opencode server stuff)needs:complianceThis means the issue will auto-close after 2 hours.This means the issue will auto-close after 2 hours.
Description
Problem
When working on WordPress projects with OpenCode, the Intelephense PHP language server does not recognize WordPress global functions like:
add_action()add_filter()wp_send_json()do_action()apply_filters()
Users must manually configure intelephense.stubs to include "wordpress" in their OpenCode config file, which is not intuitive and creates friction for WordPress developers.
Context
This affects:
- Full WordPress installations (sites with wp-config.php)
- WordPress plugins (no core files, but have plugin headers)
- WordPress themes (no core files, but have theme headers)
The WordPress stubs are already bundled with Intelephense, they just need to be enabled via configuration.
Reference: bmewburn/vscode-intelephense#1302
Proposed Solution
Automatically detect WordPress projects and enable WordPress stubs for Intelephense. Detection should work for:
- Core WordPress files (wp-config.php, wp-content/, etc.)
- Plugin headers (Plugin Name:)
- Theme headers (Theme Name:)
- WordPress code patterns (add_action, add_filter function calls)
Verification
To verify the fix works:
- Open a WordPress plugin/theme project
- Open a PHP file with WordPress functions
- Check that
add_action()and other WP functions show completions and hover info
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
coreAnything pertaining to core functionality of the application (opencode server stuff)Anything pertaining to core functionality of the application (opencode server stuff)needs:complianceThis means the issue will auto-close after 2 hours.This means the issue will auto-close after 2 hours.