Book Resources

Code and References

The complete example code is available on GitHub, organized by chapter. Each folder maps directly to the book's sections.

View repository on GitHub
NinjaTheme — The guide project that runs through the book. A complete WordPress theme built step by step, from the basic files to REST API integration, Gutenberg and professional Docker deployment.

Part I — WordPress as a Platform

Ch. 02

Setting up the environment

  • Docker Compose for local WordPress
  • wp-config.php configuration per environment
  • Environment verification script
View code →
Ch. 03

Dashboard and management

  • Roles and capabilities examples
  • Permalink configuration via WP-CLI
View code →
Ch. 07

Gutenberg and Full Site Editing

  • Complete reference theme.json
  • Block hooks and patterns
  • Basic Interactivity API
View code →
Ch. 09

Advanced responsive design

  • CSS Grid and Subgrid in WordPress themes
  • Responsive typography and images
  • Menu system and mega menus
View code →

Part II — Professional Development

Ch. 12

The WordPress Loop

  • Advanced WP_Query examples
  • Custom pagination
  • Portfolio with custom query
View code →
Ch. 14

Hooks, actions and filters

  • Hook architecture in NinjaTheme
  • Hook patterns in PHP classes
  • Critical core hooks catalog
View code →
Ch. 15

Custom Post Types

  • Portfolio CPT registration in NinjaTheme
  • Custom taxonomies
  • Meta boxes and post meta
View code →
Ch. 16

OOP in WordPress

  • NinjaTheme refactored to OOP
  • Namespaces and autoloading with Composer
  • Dependency Injection in WordPress
View code →
Ch. 18

Plugin development

  • Professional plugin structure
  • Settings API and options management
  • Transactional email with wp_mail()
View code →
Ch. 19

Database with $wpdb

  • Secure queries with $wpdb
  • Custom tables and transients
  • Schema migrations in plugins
View code →
Ch. 20

WordPress REST API

  • Complete custom endpoints
  • WP_REST_Controller and CORS
  • REST API for the portfolio in NinjaTheme
View code →
Ch. 21

JavaScript in WordPress

  • Build with @wordpress/scripts
  • REST API from JavaScript
  • Interactivity API in depth
View code →
Ch. 22

Custom Gutenberg blocks

  • Portfolio Grid block for NinjaTheme
  • Dynamic blocks with PHP render
  • Block variations, patterns and styles
View code →

Part III — Operations and Specialization

Ch. 24

Security and hardening

  • Security headers and nonces
  • WAF configuration
  • Audit scripts
View code →
Ch. 28

WP-CLI

  • Custom WP-CLI commands
  • Content migration scripts
  • Aliases and scaffolding
View code →
Ch. 29

Bedrock and Trellis

  • Bedrock structure with Composer
  • Trellis configuration per environment
  • Ansible Vault and team workflow
View code →
Ch. 30

Professional deployment and Docker

  • Production Docker Compose with Redis
  • Complete GitHub Actions CI/CD
  • Optimized Docker image for WordPress
View code →