Configuration Reference (config.json)
The config.json file located in the root of the plugin repository controls the automated renaming, build paths, and JavaScript identifiers for your plugin.
File Structure
{
"name": "Xe Plugin",
"jsObject": "xePlugin",
"endpointsKeyPrefix": "xep",
"build": "D:/Projects/Xe Plugin"
}
Properties Explained
name
- Type:
string - Description: The human-readable name of the plugin (e.g.,
"Apex CRM"or"Modern Shop"). - Usage: Used during
php xe initto derive: - Slug: Hyphenated lowercase version (
apex-crm). - Namespace: PascalCase version (
ApexCRM). - Constant prefix: Uppercase underscore version (
APEX_CRM_). - Function & Hook prefix: Lowercase underscore version (
_apex_crm_). - Text Domain:
apex-crm. - Main plugin file:
apex-crm.php.
jsObject
- Type:
string - Description: The name of the JavaScript object attached to
windowwhen localized scripts are enqueued withwp_localize_script(). - Example:
"apexCrm" - Result in JavaScript:
endpointsKeyPrefix
- Type:
string - Description: A short unique prefix used for rewrite endpoint keys and virtual page template identifiers.
- Example:
"crm" - Resulting Endpoint Keys:
crm-logincrm-dashboardcrm-forgot-password
build
- Type:
string - Description: The target absolute directory path where production builds will be generated when running
php xe build. - Example:
"C:/Users/Developer/Desktop/Builds"or"/var/www/builds" - Output: A clean directory named after your plugin slug containing only distribution-ready files and freshly compiled
.pottranslation files.