Skip to content
master
Switch branches/tags
Go to file
Code

Intervention

Easily customize wp-admin and configure application options.

Installation

Composer/Bedrock

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

WP-CLI

$ wp plugin install https://github.com/soberwp/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

Common

Dashboard

Posts

Media

Pages

Comments

Appearance

Plugins

Users

Tools

Settings

Application

Set application options.

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

Return application.

<?php

return [
    'application' => [
        'general' => [
            'tagline' => 'Intervention',
            'wp-address' => 'https://soberwp.com/wp',
            'site-address' => 'https://soberwp.com',
            'admin-email' => 'example@soberwp.com',
            '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

Quick Reference

Updating

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

  • Better visual documentation.
  • Better support for the block editor.
  • Support wp-admin custom post types.

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