Skip to content

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.


ClassConfig FilePurpose
Custom Post Typepost-types_config.phpRegister CPTs with Terra extensions (hide permalink, redirect, custom columns)
Custom Taxonomytaxonomy_config.phpRegister custom taxonomies
Custom API Endpointendpoint_config.phpRegister REST API endpoints with validation and sanitization
AJAX Requestajax_config.phpSecure AJAX handlers with nonce verification and sanitization
Custom Blockscustom-blocks_config.phpRegister custom ACF Gutenberg blocks with automatic field registration
ClassConfig FilePurpose
ACF BuilderIsland-based field composition (the core pattern for defining ACF fields)
Flexible Contentflexible-modules/, flexible-heros/Register Flexible Content field groups from config arrays
Post Type Fieldspost-type-fields_config.phpAttach ACF field groups to post types, templates, and taxonomy terms
Options Pagegeneral-options/Register ACF Options Pages with tabbed layout
WYSIWYG Toolbarswysiwyg-toolbars_config.phpCustom TinyMCE toolbar presets for WYSIWYG fields
ClassConfig FilePurpose
Admin Controlleradmin-controller_config.phpHide metaboxes and redirect after save per template/post type
Admin Pageadmin-pages_config.phpRegister custom admin submenu pages under the Terra menu
Manage ColumnsCustom columns in admin post lists
ClassConfig FilePurpose
CronjobSchedule WP cron jobs
MailSend HTML emails via wp_mail
LighthousePerformance monitoring with Lighthouse API
Schema BuilderVisual JSON-LD structured data builder with Vue admin interface
System WarningAdmin monitoring dashboard for health checks and performance alerts
Module ManagerFeature flag system to enable or disable framework modules per project
Search Flexible ModulesAudit which ACF modules appear on which pages

Knowledge Check

Test your understanding of this section

Loading questions...