darrenjacoby / intervention

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Upgrading from 1.x to 2.x Confusion

akasharkbow opened this issue · comments

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?

Try remove the braces { } around “all”, that was in the docs to illustrate a variable. I will update the docs to make that more obvious tomorrow.

I have renamed {role} to $role for better clarity.

Thanks for that. Some feedback for the docs for dummies like me, I would suggest a sample file with a typical code set-up. You probably need 2-3 then a quick breakdown of things. There are lots of awesome sample code through the docs but having a working sample with the <?php at the start makes it easy to work off.

Also, you mention the file location for Sage 10. For those using Sage 9 it doesn't go in the theme root directory but it goes into /resources along with the other files like function.php.

Thanks again for your help getting me back on the right path!

Thanks @akasharkbow , I will create a demo file and mention the config file should be from the stylesheet directory versus root folder. Closing for now.