Overview
WordPress itself is not fully built using Object-Oriented Programming (OOP); it primarily relies on procedural PHP. However, to provide more flexibility and maintainability in our projects, we’ve implemented several core functions using OOP principles.
These classes are located in functions/framework/classes/ and are autoloaded via a class map in index.php. They handle everything from registering custom post types to composing ACF fields, managing AJAX requests, and controlling the admin interface.
All classes are driven by config arrays defined in functions/project/config/. The Core class reads these configs and passes them to each class automatically. See The Functions Directory for the full configuration flow.
Class Reference
Section titled “Class Reference”Core Registration
Section titled “Core Registration”| Class | Config File | Purpose |
|---|---|---|
| Custom Post Type | post-types_config.php | Register CPTs with Terra extensions (hide permalink, redirect, custom columns) |
| Custom Taxonomy | taxonomy_config.php | Register custom taxonomies |
| Custom API Endpoint | endpoint_config.php | Register REST API endpoints with validation and sanitization |
| AJAX Request | ajax_config.php | Secure AJAX handlers with nonce verification and sanitization |
| Custom Blocks | custom-blocks_config.php | Register custom ACF Gutenberg blocks with automatic field registration |
ACF & Flexible Content
Section titled “ACF & Flexible Content”| Class | Config File | Purpose |
|---|---|---|
| ACF Builder | — | Island-based field composition (the core pattern for defining ACF fields) |
| Flexible Content | flexible-modules/, flexible-heros/ | Register Flexible Content field groups from config arrays |
| Post Type Fields | post-type-fields_config.php | Attach ACF field groups to post types, templates, and taxonomy terms |
| Options Page | general-options/ | Register ACF Options Pages with tabbed layout |
| WYSIWYG Toolbars | wysiwyg-toolbars_config.php | Custom TinyMCE toolbar presets for WYSIWYG fields |
Admin Interface
Section titled “Admin Interface”| Class | Config File | Purpose |
|---|---|---|
| Admin Controller | admin-controller_config.php | Hide metaboxes and redirect after save per template/post type |
| Admin Page | admin-pages_config.php | Register custom admin submenu pages under the Terra menu |
| Manage Columns | — | Custom columns in admin post lists |
Monitoring & Tools
Section titled “Monitoring & Tools”| Class | Config File | Purpose |
|---|---|---|
| Cronjob | — | Schedule WP cron jobs |
| — | Send HTML emails via wp_mail | |
| Lighthouse | — | Performance monitoring with Lighthouse API |
| Schema Builder | — | Visual JSON-LD structured data builder with Vue admin interface |
| System Warning | — | Admin monitoring dashboard for health checks and performance alerts |
| Module Manager | — | Feature flag system to enable or disable framework modules per project |
| Search Flexible Modules | — | Audit which ACF modules appear on which pages |
Knowledge Check
Test your understanding of this section
Loading questions...