Giter Site home page Giter Site logo

darrenjacoby / intervention Goto Github PK

View Code? Open in Web Editor NEW
629.0 25.0 51.0 5.03 MB

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

License: MIT License

PHP 88.90% JavaScript 9.05% CSS 1.91% Shell 0.13%
wordpress wordpress-admin wordpress-plugin php wp-admin dashboard woocommerce intervention woocommerce-plugin wordpress-php-library

intervention's Introduction

Easily customize wp-admin and configure application options.

View on WordPress.org

Installation

Composer

$ composer require wpackagist-plugin/intervention

WP-CLI

$ wp plugin install intervention --activate

Requirements

Usage

Create config/intervention.php for Sage 10, 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.

Tip: automate exporting 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

Quick Reference

Connect

intervention's People

Contributors

9585999 avatar claytoncollie avatar darrenjacoby avatar dependabot[bot] avatar huubl avatar johnnyicarus avatar log1x avatar mike-sheppard avatar mikespainhower avatar mrgesco avatar nlemoine avatar pacotole avatar reiterbene avatar rrikesh avatar runofthemill avatar soean avatar szepeviktor avatar taylorgorman avatar teppokoivula avatar voronkovich avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

intervention's Issues

[wp-admin.common.adminbar.user]

Admin bar user options are not being removed.

Intervention: 2.0.0-rc.1
WordPress: 5.6

common.adminbar.user.[howdy, avatar, profile, edit]

Remove new WordPress Widgets

Hey.

Could we get support added to remove the new WordPress widgets? Akismet would also be nice since it's included by default.

New widgets include Audio, Custom HTML, Image, and Video.

PHP Errors in Ajax Response warning when removing comments menu item

Query Monitor yelled at me after adding remove comments menu item to my array,

'wp-admin.{all}' => [
    ...
    'comments',
],

Here's what my console had to say,

component: "Core"
file: "wp-admin/includes/plugin.php"
key: "354ba22554f7809793fd8fbf0d259701"
line: 1769
message: "Invalid argument supplied for foreach()"
stack: (3) […]
  0: "remove_menu_page()"
  1: "Sober\\I\\A\\S\\Menu->Sober\\I\\A\\S\\{closure}()"
  2: "do_action('admin_init')"
  length: 3
  <prototype>: Array []
type: "warning"

Composer install

Hi, I came across your plugin, a useful thing. As I understand the plugin is more for developers than for the user. Maybe there is an opportunity to install it through the composer, but that he went to the vendor/soberwp folder, respectively, connected and worked from there?

I understand that it can be thrown in muplugins so that, but I would like to include it by default in the developed theme as well as the controller ...

Thanks for the answer.

Dump settings out of an existing WordPress installation

Hey all,

Great idea for some code. Reminds me of a more comprehensive and automatic version of Dictator, which allows declarative WordPress environments to be set up.

My question is: is there a way to dump out existing settings from WordPress then have the array created automatically for you?

If not right now, is this a planned piece of functionality?

Thanks so much in advance.

Comments remove `WP_Scripts::localize ` error

I was testing the new awesome application.discussion => false feature and noticed that it calls the Comments::remove() which calls BlockEditor::set('discussion', true) and finally it will call wp_localize_script('intervention-block-editor', 'config', 'discussion'). But the wp_localize_script function requires the last parameter to be array so it errors out.

Should the BlockEditor::set('discussion', true) be removed or have different value? (Or if it is still working progress, sorry to rush :D)

Upgrading from 1.x to 2.x Confusion

Hello there. I'm using Sage 9 and working to upgrade the code to the latest version but sadly I can't seem to get it going. I've got the intervention.php in the theme root directory but I can't seem to figure out the code using the examples. Here is what I've got:

`<?php

return [
'wp-admin.{all}' => [
'common.adminbar',
],
];
`

Is that all I need to add into the file to get it to work?

PHP error (notice) when adding a new page/post/cpt

There's always one more... LOL I get this a notice in Query Monitor when adding a new page/post/cpt. I don't get it when editing an existing post.

WP_Block_Type_Registry::register was called incorrectly. Block type "sober/intervention-block-editor" is already registered. Please see Debugging in WordPress for more information. (This message was added in version 5.0.0.)

Docker + Roots wrong composer inclusion path

Hi,

I'm trying to add this plugin in my bedrock/roots installation with no success.

The problem is that composer tries to load the main file but at the wrong place.

I'm using docker to get a development stack (PHP-APACHE-MYSQL) and the web folder in the docker is /var/www/html mapped with web of bedrock/roots

/var/www/vendor/composer/../../web/app/plugins/intervention/src/Intervention.php

should have been

/var/www/vendor/composer/../../--->html<----/app/plugins/intervention/src/Intervention.php

Have you any idea or advice to make this working?

Thanks for any help

New realease

The last release is from 26 Aug 2017.

Please, release a new version with latest fixes included.

unable to remove plugins options page

We are using the intervention('remove-menu-items'); to remove all the "danger-item" but there some Dev plugins pages we want to remove here an example :

Custom Post Type UI (https://en-ca.wordpress.org/plugins/custom-post-type-ui/) plugins create a options page with this URL:/wp-admin/admin.php?page=cptui_manage_post_types

We tried to target this page to hide it without success like so :

intervention('remove-menu-items', ['admin.php?page=cptui_manage_post_types', ], 'admin_client');
//OR
intervention('remove-menu-items', ['cptui_manage_post_types', ], 'admin_client');

Is there a way to manually remove a page from the admin or they need to be in the list of config?

Thank for your time

A user with multiple roles confuses `remove-toolbar-frontend`

I have added intervention('remove-toolbar-frontend', 'all-not-admin'); and it removes the toolbar when a user has a role other than admin (excellent!) even when that user ALSO has an admin role (boo!).

It's an edge case so I'm flagging it up for interest really.

The following snippet works for admins who also have other roles

/* *
 *
 * Remove admin bar for all users except admin
 */

add_action('after_setup_theme', 'remove_admin_bar');

function remove_admin_bar() {
    if (!current_user_can('administrator') && !is_admin()) {
        show_admin_bar(false);
    }
}

Composer error when used with WooCommerce on v. 1.3

Hey!

Intervention 1.3 seems to break when used in conjunction with WooCommerce and Bedrock.

To reproduce:

  1. create new bedrock: composer create-project roots/bedrock
  2. install Intervention: composer require soberwp/intervention
  3. install woocommerce: composer require woocommerce/woocommerce

After the usual mess of Woocommerce deprececation notices composer fails with message:

Installation failed, reverting ./composer.json to its original content.

[RuntimeException]
Could not scan for classes inside "/Users/erik/Sites/bedrock-test/web/app/plugins/intervention/src/modules" which does not appear to be a file nor a folder

It works with 2.0.0-rc.1.

Is this version stable enough for use in production?

Composer dependencies in /dist

Hi,

Any reason for composer dependencies to be included in the dist folder? It's loading unused/dev dependencies and those are messing with my composer dependencies.

Would you consider moving those to require-dev and not adding them to the releases?

Notice: Undefined index: post

Sorry to post issues twice in a couple of days. I was using version 1.2 for a while and finally decided to upgrade yesterday. When updating a post or page, I'm getting the following errors. Any ideas why?

Notice: Undefined index: post in /srv/www/site/current/web/app/plugins/intervention/src/Admin/Posts/Edit.php on line 97

Notice: Undefined index: post in /srv/www/site/current/web/app/plugins/intervention/src/Admin/Pages/Edit.php on line 96

Plugin could not be activated because it triggered a fatal error

Warning: require(/wp-content/plugins/intervention/dist/composer/../symfony/polyfill-mbstring/bootstrap.php): failed to open stream: No such file or directory in /wp-content/plugins/intervention/dist/composer/autoload_real.php on line 69

PHP 7.4.14
Intervention 2.0.0-rc.3
WordPress 5.7.2

Need help to install plugin

Hi, @darrenjacoby. I am unable to install the plugin correctly on Bedrock / Sage10. First of all, I try it with Composer, but the macOS PHP version is 7.3.24 (Vagrant box has 7.4.21):

 [InvalidArgumentException]
 Package soberwp / intervention at version dev-master has a PHP requirement in compatible with your PHP version, PHP extensions and Composer version:
     - soberwp / intervention requires php ^ 7.4 | ^ 8.0 which does not match your i nstalled version 7.3.24.
     - soberwp / intervention requires tightenco / collect ^ 8 but it is not present.

Second, I try the wp-cli command. After installation I get this warning:

Warning: require(/srv/www/arte-conocimiento.com/current/web/app/plugins/intervention/dist/composer/../symfony/var-dumper/Resources/functions/dump.php): failed to open stream: No such file or directory in /srv/www/arte-conocimiento.com/current/web/app/plugins/intervention/dist/composer/autoload_real.php on line 69

Fatal error: require(): Failed opening required '/srv/www/arte-conocimiento.com/current/web/app/plugins/intervention/dist/composer/../symfony/var-dumper/Resources/functions/dump.php' (include_path='.:/usr/share/php') in /srv/www/arte-conocimiento.com/current/web/app/plugins/intervention/dist/composer/autoload_real.php on line 69

I'm not sure what the problem is. Could you suggest a diagnosis / solution? Thank you!

all-not-administrator with multiple roles

I've created a membership style site so each user has multiple roles depending on whether they are signed up.

Not got too far with the setup, but when trying to set options separately using all-not-administrator it has no effect. Guessing this is due to the multiple roles. Is there a way around this?

E.g. With the following, I can't see any updates when logged in as admin.

'wp-admin.all' => [ 'common.adminbar.wp' ], 'wp-admin.all-not-administrator' => [ 'common.updates' ]

add-menu-item

Is there any sense in having an add-menu-item function? Could just add it in the regular way, but would be nice and clean to include it with Intervention.

Many thanks!

Language not changing

Hi,

I try to set the default language to dutch in version: 2.0.0-rc.2 with the config below:

return [
    'application' => [
        'general' => [
            [...]
            'language' => 'nl_NL',
            'timezone' => 'Europe/Amsterdam',
            'date-format' => 'j F Y',
            'time-format' => 'H:i',
            'week-starts' => 'Mon',
    ],
     [...]
];

Somehow the language is not changing, you know why?

Doesn't work on multisite install

Like the title says. No errors or anything, just didn't work.

Not a big deal for me, I just rolled that client back to ver. 1.3, it's fine on that version with WP's infinite backwards compatibility 😄

Something goes wrong setting options / saving to database

Hi,

Something goes wrong when using this settings:

<?php
use function Env\env;

return [
    'application' => [
        'general' => [
            'site-title' => 'My website',
            'wp-address' => env('WP_SITEURL'),
            'site-address' => env('WP_HOME'),
            'admin-email' => '[email protected]',
            'admin-email.verification' => false,
            'email-from' => '[email protected]',
            'email-from-name' => 'My website',
            'membership' => false,
            'default-role' => 'subscriber',
            'language' => 'nl_NL',
            'timezone' => 'Europe/Amsterdam',
            'date-format' => 'j F Y',
            'time-format' => 'H:i',
            'week-starts' => 'Mon',
        ],
        'writing' => [
            'emoji' => false,
            'default-category' => 1,
            'default-post-format' => 'standard',
            'post-via-email.server' => 'mail.example.com',
            'post-via-email.port' => 110,
            'post-via-email.login' => '[email protected]',
            'post-via-email.pass' => 'password',
            'post-via-email.default-category' => 1,
            'update-services' => 'http://rpc.pingomatic.com/',
        ],
        'reading' => [
            'front-page' => 2,
            'front-page.posts' => 454,
            'posts-per-page' => 9,
            'posts-per-rss' => 9,
            'rss-excerpt' => 'summary',
        ],
        'media' => [
            'sizes.thumbnail' => [
                'width' => 300,
                'height' => 200,
                'crop' => true,
            ],
            'sizes.medium' => [
                'width' => 640,
                'height' => 480,
            ],
            'sizes.large' => [
                'width' => 1100,
                'height' => 800,
            ],
            'uploads.organize' => true,
        ],
        'permalinks' => [
            'structure' => '/nieuws/%year%/%monthnum%/%day%/%postname%/',
            'category-base' => 'nieuws/categorie',
            'tag-base' => 'nieuws/tag',
        ],
        'privacy.policy-page' => 2731,
    ],
];

When I check the database values, they are not changing or (when I click save on the admin general settings page ) wrong. For example the media options get:

option_name option_value autoload
thumbnail_size_w 0 no
thumbnail_size_h 0 no
thumbnail_crop 1 no
medium_size_w 0 no
medium_size_h 0 no

When saving the (partly) locked setting on the admin general settings page (by the save button ) and then comment out the application -> general settings I get this:

image

Am I doing something wrong?

  • Using Intervention dev-master branch (loaded as mu-plugin)
  • Bedrock / Sage 10

current_user_can before plugins_loaded

If I call intervention('remove-update-notices'); I get an error.

Call to undefined function wp_get_current_user()

This is because the current_user_can() check is to early.

The only prerequisite for current_user_can() is an existing wp_get_current_user(). The latter is defined in pluggable.php, so you can use it after plugins_loaded.

source: http://wordpress.stackexchange.com/questions/198185/what-is-valid-timing-of-using-current-user-can-and-related-functions

posts.all.title throws php errors and ajax errors

I have another one for you, when setting 'posts.all.title' => 'title' I get the following php error,

Notice: Undefined index: post_type in /var/www/html/wp-content/plugins/intervention-master/src/Admin/Posts/All.php on line 113

and when running Query Monitor I get the following php ajax error in the browser console on the All Posts page that continues to repeat every 10 seconds or so,

Object { key: "6cca9fbdd5457d43a614d4f7f4251b6f", type: "notice", message: "Undefined index: post_type", file: "wp-content/plugins/intervention-master/src/Admin/Posts/All.php", line: 113, stack: (5) […], component: "Plugin: intervention-master" }
post-type-title-ajax-error

It also does not set the menu title, even when using 'posts.all.title.menu', and it sets the page title of all post types to the new posts title (Pages and CPT's). I've attached a couple screenshots for reference.

post-type-title-error2
post-type-title-error

This does not occur when setting 'pages.all.title', however it does not change the Pages menu title, even when specifying it with 'pages.all.title.menu'.

Noob trouble trying to get Intervention working.

Forewarning, I am likely being a complete dolt here but I can't get this to work.

I've installed a must-use plugin through composer. The plugin itself is being loaded (I did a trusty echo "test"; exit;, to check), but the intervention.php file I've included in the root of my theme doesn't seem to be being loaded.

- ~
-   app
  -  themes
    - my-theme
      - intervention.php

I've got the following in intervention.php

<?php

return [
    'wp-admin.all' => [
        'dashboard' => 'posts',
    ],
];

And naturally I'm expecting the dashboard menu to be removed and redirect to posts, but no dice.

Anything glaringly incorrect in this setup? Any help welcome 😢

Question: Why use update_option instead of pre_option_{$option} filter

This is a very nice plugin and something I have been looking for for a long time. Great job. I did have a general question tho. Why are you updating the database all of the time with update_option calls. Why not use the pre_option_{$option} filter to short circuit the database call? Seems like it would improve performance and also log the options down to whatever you set in your array.

https://developer.wordpress.org/reference/hooks/pre_option_option/

[application.posts] plural form is automatic; won't use parameter

Heya;

custom post types are using the auto-pluralised rather than the 'many' parameters

I'm trying to get to use the french plural (Lieux) I specify in the config/intervention.php (cf below), but it just outputs the auto-pluralised version (Lieus) in the admin menu:

  • in the LHS menu, in the admin
  • in the header listing my single classes in the admin edit.php?post_type=places
            'places' => [
                'one' => 'Lieu',
                'many' => 'Lieux',
            ]

Labels translations

I was wondering if the function order related to translations in src/Application/Support/Posttypes/Labels.php and src/Application/Support/Taxonomies/Labels.php is intended as it is now? So currently the sprintf method is called inside __ function – for example __(sprintf('Add New %s', $this->one), $i18n).

This makes the making of the translation bit hard because all post types should be translated separately (like Add New Posttype1, Add New Posttype2) and the pot-file generators doesn't pick strings like __(sprintf(....

I would suggest changing the order to be sprintf(__('Add New %s', $i18n), $this->one) so that it's easier to make translations.

I have tested the change locally already so I can contribute the change if you feel the change is alright.

(And thanks for making the plugin, really needed and has great features! 🙏)

Remove customize does not work as expected (remove cutomizer link wont work in intervention 2)

As far as I understand it, one can remove the customizer link by using something like this (roots/bedrock, intervention 2 (master), sage 10 via config/intervention.php, Wordpress 5.6.1):

config/intervention.php

<?php

return [
    'wp-admin.all' => [
        'appearance.customize',
    ],
];

although, this disables the customizer functionality, it does not remove the customizer menu link.
If that is the expected behavior we should update the corresponding readme.md file. if not there might be a bug.

At least the removal of the parent menu works as expected, so I consider my understanding of the mechanism as correct (?) - the following works for me and removes the 'design' (= appearance) menu item completely:

<?php

return [
    'wp-admin.all' => [
        'appearance',
    ],
];

How can I remove the customizer link entirely?

the "plain" vairant without using intervention could look like this example:

add_action( 'admin_menu', function () {
    global $submenu;

    if ( isset( $submenu[ 'themes.php' ] ) ) {
        foreach ( $submenu[ 'themes.php' ] as $index => $menuItem ) {
            if ( in_array( 'customize', $menuItem ) ) {
                unset( $submenu[ 'themes.php' ][ $index ] );
            }
        }
    }
});

'remove-widgets' not working

Hi there,

the intervention( 'remove-widgets' ); doesn´t work in my setup. Still all WordPress Widgets are present in backend:
Widgets in backend

My code:

<?php
require __DIR__ . '/../vendor/autoload.php';
use function \Sober\Intervention\intervention;

if (function_exists('Sober\Intervention\intervention')) {
	add_action( 'init', function() {
		// Add Welcome Dashboard
		intervention( 'add-dashboard-item', [
			'Willkommen',
			'Willkommen im Backend der ' . get_bloginfo( 'name' )
		] );
		// Add SVG Support
		intervention( 'add-svg-support', [
			'admin',
			'editor'
		] );
		// Remove Dashboard Items
		intervention( 'remove-dashboard-items' );
		// Remove Emoji
		intervention( 'remove-emoji' );
		// Remove Howdy
		intervention( 'remove-howdy', '' );
		// Remove footer
		intervention( 'update-label-footer', 'Mit &#x2764; von <a href="https://wdj.ac">wdj Digitalagentur</a>' );
		// Remove Page Components
		intervention( 'remove-page-components', [
			'author',
			'comments'
		] );
		// Remove Post Components
		intervention( 'remove-post-components', [
			'comments',
			'trackbacks'
		] );
		// Remove toolbar from non-admin users
		intervention( 'remove-toolbar-frontend', [
			'all-not-admin'
		] );
		// Remove unused user fields
		intervention( 'remove-user-fields', [
			'option-title',
			'option-editor',
			'option-schemes',
			'option-shortcuts',
			'option-toolbar',
			'contact',
			'contact-web',
			'about',
			'about-bio',
			'about-profile'
		] );
		// Remove toolbar items for all
		intervention( 'remove-toolbar-items', [
			'logo',
			'comments',
			'customize',
		], [ 'all' ] );
		// Remove toolbar items for non-admin users
		intervention( 'remove-toolbar-items', [
			'updates',
		], [ 'all-not-admin' ] );
		// Remove update notices from non-admin users
		intervention( 'remove-update-notices', [
			'editor',
			'author'
		] );
		// Remove senseless user roles from WordPress
		intervention( 'remove-user-roles', [
			'subscriber',
			'contributor'
		] );
		// Remove Widgets
		intervention( 'remove-widgets' );
		// Default 100 pagination
		intervention( 'update-pagination', 100 );
		// Remove Menu items
		intervention( 'remove-menu-items', 'danger-zone', 'all-not-admin' );
		intervention( 'remove-menu-items', [
			'comments',
			'media',
			'media-new',
			'plugin-editor',
			'theme-editor'
		], 'all' );
		intervention( 'remove-menu-items', [
			'tool-import',
			'tool-export',
			'acf',
			'acf-new',
			'acf-tools',
			'acf-updates',
		], 'all-not-admin' );
	});
} 

Any ideas what could cause this issue?

CPT registration - add support for 'supports' new array of arguments, which leads the way to adding 'template' support

This is more about the second item (yeah, I'm finally starting to deal with Gutenberg for CPT's), but the format it accepts is the same as the newly optional array of arguments in the supports key. Neither work, an array to string conversion error is returned. I tried to add a Register->setTemplate() method figuring I could mimic the setSupports() method, but it doesn't support the nested arrays. Then I ended up spending too much time reading Laravel docs to figure out your code, so you get this instead of a PR.

There's no rush on this, I can still add my CPT's the "old fashioned way"!

Example:

'supports' => [
    'title',
    'editor',
    'thumbnail',
    [ 'my_feature', [                // newly added support, likely for Gutenberg
	  'field' => 'value',
    ] ],
 ],

'template' => [                     // added with Gutenberg, but wasn't documented until recently
     [ 'core/paragraph', [
           'placeholder' => 'Add a description...',
     ]  ],
],
'template_lock' => 'all',

https://developer.wordpress.org/reference/functions/register_post_type/#changelog
https://core.trac.wordpress.org/browser/tags/5.6/src/wp-includes/class-wp-post-type.php#L395

Remove Toolbar Frontend

Not sure if that's the intention but if I set up to show the tool bar in the user profile: intervention('remove-toolbar-frontend'); has no effect.

I presume it would overide what a user might add there.

feature request for clean wp_head

Awesome plugin along with models!! Thanks.

I have idea to few improvements:

  1. add support to remove wp-embed
  2. add suport to clean wp_head meta tags
  3. add support to hide comments from topbar in admin

remove_menu_page(): E_WARNING: Invalid argument supplied for foreach()

remove_menu_page() sometimes : E_WARNING: Invalid argument supplied for foreach()

Problematic code:

function remove_menu_page( $menu_slug ) {
  global $menu;
  foreach ( $menu as $i => $item ) {
  // ...

URL /wp/wp-admin/admin-ajax.php
HTTP referrer https://SOME_SITE/wp/wp-admin/network/users.php

Stack trace:

/vendor/soberwp/intervention/src/Module/RemoveMenuItems.php (121)
/web/wp/wp-includes/class-wp-hook.php (286)
/web/wp/wp-includes/class-wp-hook.php (310)
/web/wp/wp-includes/plugin.php (453)
/web/wp/wp-admin/admin-ajax.php (44)

Offending line:
https://github.com/soberwp/intervention/blob/7d69c58b32fce29aad08e4ff9c9de43963122610/src/Module/RemoveMenuItems.php#L121

Possible reason: global $menu not defined?

Upstream bug report:
https://core.trac.wordpress.org/ticket/43714

Remove update_footer

To remove the version and the update message from the admin footer, this filter should be added to a module:

remove_filter( 'update_footer', 'core_update_footer' );

[application.posts]

Hi guys!

It looks like in the intervention/src/Application/Support/Posttypes/Register.php the setSupports method is broken.

It returns this:

object(Tightenco\Collect\Support\Collection)#1561 (1) {
  ["items":protected]=>
  array(1) {
    [0]=>
    string(8) "supports"
  }
}

Instead of something like this:

array(2) {
  [0]=>
  string(5) "title"
  [1]=>
  string(6) "editor"
}

wp_register_script called incorrectly error - v. 2.0.0rc1

I keep getting this error message on 2.0.0rc1 (from master) when editing/creating a new a page/post that's using the Gutenberg editor.

Notice: wp_register_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the intervention-block-editor handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.) in /var/www/html/wp-includes/functions.php on line 5311

It appears once when editing a post/page, and is repeating three times when creating a new one. This error is also generated when creating a new CPT page using the classic editor:

Notice: WP_Block_Type_Registry::register was called incorrectly. Block type "sober/intervention-block-editor" is already registered. Please see Debugging in WordPress for more information. (This message was added in version 5.0.0.) in /var/www/html/wp-includes/functions.php on line 5311

I've narrowed the offending functions to posts.item.trackbacks, posts.item.discussion, and pages.item.discussion, all under wp-admin.all.

Feature idea: add theme supports

I came across: https://github.com/roots/sage/pull/2189/files and thought it can be useful for Intervention. What do you think about adding an option for setting theme supports?

// Add theme supports
collect(config('theme.add_theme_support'))->each(function ($options, $feature) {
    $options
        ? add_theme_support($feature, $options)
        : add_theme_support($feature);
});
[..]
    'theme' => [
        'add_theme_support' => [


            /*
            |--------------------------------------------------------------------------
            | Add Title Tag Support
            |--------------------------------------------------------------------------
            |
            | Enable plugins to manage the document title
            |
            | @link https://developer.wordpress.org/reference/functions/add_theme_support/#title-tag
            |
            */

            'title',


            /*
            |--------------------------------------------------------------------------
            | Enable post thumbnails
            |--------------------------------------------------------------------------
            |
            | Featured images (also sometimes called Post Thumbnails) are images that
            | represent an individual Post, Page, or Custom Post Type.
            |
            | @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
            |
            */

            'post-thumbnails',


            /*
            |--------------------------------------------------------------------------
            | Enable HTML5 markup support
            |--------------------------------------------------------------------------
            |
            | This feature allows the use of HTML5 markup for the search forms,
            | comment forms, comment lists, gallery, and caption.
            |
            | @link https://developer.wordpress.org/reference/functions/add_theme_support/#html5
            |
            */

            'html5' => ['caption', 'comment-form', 'comment-list', 'gallery', 'search-form'],


            /*
            |--------------------------------------------------------------------------
            | Enable customizer selective refresh
            |--------------------------------------------------------------------------
            |
            | Enable selective refresh for widgets in customizer
            |
            | @link https://developer.wordpress.org/themes/customize-api/
            |
            */

            'customize-selective-refresh-widgets',
        ]
[..]

update-pagination force update_user_meta on every page load

update-pagination module force three update_user_meta for every user on every page load.
On a page with many users, like a Woocommerce shop with a lot of clients, causes a great delay on every charge of dashboard pages (3 * SELECT, UPDATE * user).

Translatable labels

Hi,

Adding translatable labels is not working, any idea what could be the issue?

<?php

return [
    'application.posts' => [
        'book' => [
            'one' => __('Book', 'text-domain'),
            'many' => __('Books', 'text-domain'),
            'supports' => [
                'title', 'thumbnail', 'editor'
            ],
            'has-archive' => true,
            'hierarchical' => false,
            'menu-position' => 10,
            'labels' => [
                'all_items' => __('All items', 'text-domain'),
                'add_new' => __('Add new', 'text-domain'),
               [..]
        ],
    ],
];

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.