Maintainer overview of how external file bodies enter ElasticPress documents.
Modules
ModuleInitialization loads PHP modules under includes/classes/. Two primary modules:
| Class | Role |
|---|---|
ExternalContent | Reads meta keys, fetches file contents, appends stored meta for ES, adds search fields |
Feature | On feature posts with prc-platform/feature-loader, writes feature_files JSON meta and opts that key into external-content indexing |
Indexing flow
External content index
ep_external_content_meta_keys lists which meta keys hold JSON arrays of paths/URLs. Contents are read from the local filesystem when possible, otherwise via wp_remote_get. Filters:
| Filter | Purpose |
|---|---|
ep_external_content_meta_keys | Declare source meta keys |
ep_external_content_stored_meta_key | Override stored meta key name (default ep_external_content_{key}) |
ep_external_content_file_content | Transform file body before storage |
Feature files
For feature posts, Feature::set_post_meta parses prc-platform/feature-loader blocks, collects JS asset URLs and data attachment URLs, and stores them on feature_files. That key is allow-listed for VIP Search meta and registered via ep_external_content_meta_keys.
Bootstrap
Entry file prc-ep-external-content.php loads helpers and includes/core.php. When PRC_PLATFORM is defined, the monorepo root autoloader is used; otherwise the plugin vendor Jetpack Autoloader may load.