PHPackages                             kodansha/wack-foundation - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. kodansha/wack-foundation

ActiveWordpress-theme[Utility &amp; Helpers](/categories/utility)

kodansha/wack-foundation
========================

The base (parent) theme for WACK stack based WordPress projects.

v0.8.0(2mo ago)085↓50%[1 PRs](https://github.com/kodansha/wack-foundation/pulls)GPL-3.0-or-laterPHPPHP &gt;=8.3

Since Nov 11Pushed 2mo agoCompare

[ Source](https://github.com/kodansha/wack-foundation)[ Packagist](https://packagist.org/packages/kodansha/wack-foundation)[ Docs](https://github.com/kodansha/wack-foundation)[ RSS](/packages/kodansha-wack-foundation/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (14)Used By (0)

WACK Foundation Theme
=====================

[](#wack-foundation-theme)

- [WACK Foundation Theme](#wack-foundation-theme)
    - [Overview](#overview)
    - [Purpose &amp; Design Philosophy](#purpose--design-philosophy)
        - [Key Principles](#key-principles)
    - [Installation](#installation)
        - [Installing via Composer](#installing-via-composer)
        - [Using as a Parent Theme](#using-as-a-parent-theme)
        - [Setting Up PSR-4 Autoloading](#setting-up-psr-4-autoloading)
    - [Features](#features)
        - [Appearance](#appearance)
            - [Admin Favicon](#admin-favicon)
        - [Comment](#comment)
            - [Comment Disabler](#comment-disabler)
        - [Dashboard](#dashboard)
            - [Dashboard Disabler](#dashboard-disabler)
                - [`wack_dashboard_redirect_url`](#wack_dashboard_redirect_url)
                - [`wack_dashboard_allowed_capabilities`](#wack_dashboard_allowed_capabilities)
        - [Editor](#editor)
            - [Block Type Controller](#block-type-controller)
                - [`wack_block_type_enabled_types`](#wack_block_type_enabled_types)
            - [Block Style Manager](#block-style-manager)
                - [`wack_block_style_enabled_styles`](#wack_block_style_enabled_styles)
            - [Format Controller](#format-controller)
                - [`wack_text_format_enabled_types`](#wack_text_format_enabled_types)
            - [Link Suggestion Disabler](#link-suggestion-disabler)
                - [`wack_link_suggestion_disabled`](#wack_link_suggestion_disabled)
            - [Block Variation Manager](#block-variation-manager)
                - [`wack_block_enabled_variations`](#wack_block_enabled_variations)
            - [Content Editor Disabler](#content-editor-disabler)
                - [`wack_content_editor_disabled_post_types`](#wack_content_editor_disabled_post_types)
            - [Quick Edit Disabler](#quick-edit-disabler)
                - [`wack_quick_edit_enabled_post_types`](#wack_quick_edit_enabled_post_types)
            - [UI Customization Workaround](#ui-customization-workaround)
                - [`wack_ui_workaround_disabled_features`](#wack_ui_workaround_disabled_features)
        - [Media](#media)
            - [Image Size Control](#image-size-control)
                - [`wack_image_size_control_custom_sizes`](#wack_image_size_control_custom_sizes)
            - [Media Filename Normalizer](#media-filename-normalizer)
                - [`media_filename_generator`](#media_filename_generator)
        - [Security](#security)
            - [REST API Controller](#rest-api-controller)
                - [`wack_rest_api_namespace_whitelist`](#wack_rest_api_namespace_whitelist)
                - [`wack_rest_api_forbidden_routes`](#wack_rest_api_forbidden_routes)
            - [XML-RPC Disabler](#xml-rpc-disabler)
        - [Health Check](#health-check)
            - [Health Check Endpoint](#health-check-endpoint)
        - [PostType &amp; Taxonomy Base Classes](#posttype--taxonomy-base-classes)
            - [BasePostType](#baseposttype)
            - [BaseTaxonomy](#basetaxonomy)
        - [Validation](#validation)
            - [BaseValidation](#basevalidation)
    - [Killer Pads Users](#killer-pads-users)

Overview
--------

[](#overview)

WACK Foundation is a battle-tested parent theme designed specifically for headless WordPress deployments. It provides a curated set of features that disable unnecessary functionality by default while offering granular control through WordPress filters to re-enable features as needed.

By using this as a parent theme, you gain:

- **Security hardening** out of the box (XML-RPC disabled, REST API access control, etc.)
- **Block editor optimization** for headless workflows (reduced block types, disabled Quick Edit, etc.)
- **Filter-based extensibility** for all features
- **Zero configuration** required for sensible defaults

Purpose &amp; Design Philosophy
-------------------------------

[](#purpose--design-philosophy)

This theme is built for **headless WordPress** setups where:

- Content is managed in WordPress but rendered on a separate frontend
- The block editor (Gutenberg) is used for structured content authoring
- Security and performance are prioritized over convenience features
- Child themes extend functionality through filters rather than overriding templates

### Key Principles

[](#key-principles)

1. **Deny by default, allow by exception**: Features are disabled unless explicitly enabled
2. **Filter-driven configuration**: All behavior is customizable via WordPress filters (except abstract base classes like `BasePostType`, `BaseTaxonomy`, and `BaseValidation`, which require class inheritance)
3. **Minimal footprint**: No bloat, no legacy compatibility, no frontend assets
4. **Developer-friendly**: Clear APIs, comprehensive documentation, predictable behavior

Installation
------------

[](#installation)

### Installing via Composer

[](#installing-via-composer)

This theme is available only through Composer.

**Installation steps:**

1. Require the theme package:

```
composer require kodansha/wack-foundation
```

2. The theme will be installed to `web/app/themes/wack-foundation` (when using Bedrock) or `wp-content/themes/wack-foundation` (standard WordPress).
3. Activate the theme or use it as a parent theme for your child theme.

### Using as a Parent Theme

[](#using-as-a-parent-theme)

To use WACK Foundation as a parent theme, specify it in your child theme's `style.css`:

```
/*
Theme Name: Your Child Theme Name
Template: wack-foundation
Version: 1.0.0
*/
```

The `Template` field must match the directory name of the WACK Foundation theme.

### Setting Up PSR-4 Autoloading

[](#setting-up-psr-4-autoloading)

To use abstract base classes like `BasePostType`, `BaseTaxonomy`, and `BaseValidation`, you'll need to set up PSR-4 autoloading for your child theme.

**For Bedrock projects:**

Add your theme namespace to `composer.json`:

```
{
  "autoload": {
    "psr-4": {
      "MyTheme\\": "web/app/themes/my-theme/src/"
    }
  }
}
```

After updating `composer.json`, regenerate the autoloader:

```
composer dump-autoload
```

**Directory structure:**

Organize your classes following PSR-4 conventions:

```
web/app/themes/my-theme/  (or wp-content/themes/my-theme/)
├── src/
│   ├── PostTypes/
│   │   ├── AuthorPostType.php      (MyTheme\PostTypes\AuthorPostType)
│   │   └── ProductPostType.php     (MyTheme\PostTypes\ProductPostType)
│   ├── Taxonomies/
│   │   └── GenreTaxonomy.php       (MyTheme\Taxonomies\GenreTaxonomy)
│   └── Validations/
│       └── PostValidation.php      (MyTheme\Validations\PostValidation)
├── functions.php
└── style.css

```

**Example class file** (`src/PostTypes/AuthorPostType.php`):

```
