Development
Prerequisites
Section titled “Prerequisites”- Node.js 18+
- PHP 8.3+
- Composer
Build Assets
Section titled “Build Assets”npm installnpm run buildFor development with watch mode:
npm run devRun Tests
Section titled “Run Tests”PHP Tests
Section titled “PHP Tests”composer installcomposer testJavaScript Tests
Section titled “JavaScript Tests”npm testRun tests once (CI mode):
npm test -- --runGenerate Translations
Section titled “Generate Translations”npm run i18nThis command runs the full translation workflow:
- Extracts strings to
.potfile - Updates
.pofiles - Compiles
.mofiles - Generates JSON for JavaScript
- Creates PHP translation files
Lint Code
Section titled “Lint Code”composer lintJavaScript
Section titled “JavaScript”npm run lint:jsnpm run lint:cssProject Structure
Section titled “Project Structure”vmfa-editorial-workflow/├── build/ # Compiled assets├── docs/ # Documentation├── languages/ # Translation files├── src/│ ├── css/ # Source stylesheets│ ├── js/ # Source JavaScript/React│ │ ├── review/ # Review page scripts│ │ └── settings/ # Settings panel components│ └── php/ # PHP classes│ ├── Admin/ # Admin pages│ ├── REST/ # REST API endpoints│ └── Services/ # Business logic├── tests/│ └── php/ # PHPUnit tests└── vendor/ # Composer dependenciesCoding Standards
Section titled “Coding Standards”- PHP: WordPress Coding Standards (WPCS)
- JavaScript: WordPress ESLint configuration
- CSS: WordPress Stylelint configuration
Hooks Reference
Section titled “Hooks Reference”Actions
Section titled “Actions”| Hook | Description | Parameters |
|---|---|---|
vmfa_inbox_assigned | Fired after upload is routed to inbox | $attachment_id, $folder_id, $user_id |
vmfa_marked_needs_review | Fired after item marked for review | $attachment_id, $folder_id |
vmfa_approved | Fired after item is approved | $attachment_id, $folder_id |
Filters
Section titled “Filters”The plugin integrates with VMF core hooks:
| Filter | Description |
|---|---|
vmfo_can_delete_folder | Used to protect system folders |
REST API
Section titled “REST API”Endpoints
Section titled “Endpoints”| Method | Endpoint | Description |
|---|---|---|
| GET | /vmfa-editorial/v1/settings | Get all settings |
| POST | /vmfa-editorial/v1/settings | Update all settings |
| GET | /vmfa-editorial/v1/permissions | Get folder permissions |
| POST | /vmfa-editorial/v1/permissions | Update folder permissions |
| GET | /vmfa-editorial/v1/inbox | Get inbox mapping |
| POST | /vmfa-editorial/v1/inbox | Update inbox mapping |
| GET | /vmfa-editorial/v1/workflow | Get workflow settings |
| POST | /vmfa-editorial/v1/workflow | Update workflow settings |
All endpoints require manage_options capability.
📦 Source: soderlind/vmfa-editorial-workflow · Edit on GitHub