intervention icon indicating copy to clipboard operation
intervention copied to clipboard

WordPress plugin to configure wp-admin and application state using a single config file.

Intervention

Easily customize wp-admin and configure application options.

New: Intervention now ships with a full user interface for setting wp-admin options and exporting application options. The user interface can be found under menu item Tools/Intervention.

Installation

Composer/Bedrock

$ composer require soberwp/intervention:dev-main
$ wp plugin activate intervention

WP-CLI

$ wp plugin install https://github.com/darrenjacoby/intervention/archive/master.zip --activate

Requirements

Usage

Create config/intervention.php for Sage 10, resources/intervention.php for Sage 9, or intervention.php inside your theme root folder and return an array.

<?php

return [
    'application' => [

    ],
    'wp-admin.$role|$username' => [

    ],
];

For the options, you can use dot notatation, a standard array, or a combination.

Admin

Remove components from wp-admin.

Return wp-admin.$role or wp-admin.$username

  • Support for multiple user roles using a pipe operator.
    • editor|author
<?php

return [
    'wp-admin.$role|$username' => [
        'common.adminbar',
    ],
];

User Roles

  • all
  • all-not-administrator (shortcut alias)
  • administrator
  • author
  • editor
  • contributor
  • subscriber

Options

Login

  • login

Common

  • common.adminbar
  • common.editor
  • common.footer
  • common.menu
  • common.tabs
  • common.title-link
  • common.updates
  • common.all.list
  • common.all.pagination
  • common.all.search
  • common.all.subsets

Dashboard

  • dashboard
  • dashboard.home
  • dashboard.updates

Posts

  • posts
  • posts.all
  • posts.item
  • posts.categories.all
  • posts.categories.item
  • posts.tags.all
  • posts.tags.item

Media

  • media
  • media.all
  • media.add

Pages

  • pages
  • pages.all
  • pages.item

Comments

  • comments
  • comments.all

Appearance

  • appearance
  • appearance.themes
  • appearance.customize
  • appearance.widgets
  • appearance.menus
  • appearance.theme-editor

Plugins

  • plugins
  • plugins.all
  • plugins.add
  • plugins.plugin-editor

Users

  • users
  • users.all
  • users.add
  • users.profile

Tools

  • tools
  • tools.available
  • tools.import
  • tools.export
  • tools.site-health
  • tools.export-personal-data
  • tools.erase-personal-data

Settings

  • settings
  • settings.general
  • settings.writing
  • settings.reading
  • settings.discussion
  • settings.media
  • settings.permalinks

Application

Set application options.

  • Options are automatically changed to read only fields in wp-admin.
  • Options can be placed under version control.

Return application.

New! You can auto-generate/export a config file from the database using Tools/Intervention in the WordPress admin.

<?php

return [
    'application' => [
        'general' => [
            'tagline' => 'Intervention Example',
            'wp-address' => 'https://example.com/wp',
            'site-address' => 'https://example.com',
            'admin-email' => '[email protected]',
            'membership' => false,
            'default-role' => 'editor',
            'language' => 'en_US',
            'timezone' => 'Africa/Johannesburg',
            'date-format' => 'F j Y',
            'time-format' => 'g:i a',
            'week-starts' => 'Mon',
        ],
    ],
];

Options

  • theme
  • posts/posttypes
  • taxonomies
  • menus
  • plugins
  • general
  • reading
  • writing
  • discussion
  • media
  • permalinks
  • privacy

Quick Reference

  • Full configuration options
  • Full configuration example
  • Register custom posttype
  • Register custom taxonomy
  • Register custom image sizes
  • Register custom nav menu
  • Remove comments
  • Remove posttype
  • Remove taxonomy
  • Remove image size
  • Remove emoji
  • Remove attachments
  • Enable custom media/mime types

Updating

  • Guide to upgrade from version 1.x.x to 2.x.x

Composer

  • Change the composer.json version to ^2.0.0**
  • Check CHANGELOG.md for any breaking changes before updating.
$ composer update

WordPress

Includes support for github-updater to track updates through wp-admin.

Roadmap

  • ✅ Export database values to Intervention config file.
  • ✅ Save to database manual option (update_option vs pre_option).
  • ✅ Intervention wp-admin interface.
  • Better support for the block editor.
  • Support wp-admin custom post types.

Have a suggestion, or want to track new releases? @withjacoby

If you would like to buy me a coffee, paypal.me/darrenjacoby