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

Noob trouble trying to get Intervention working.

jonsherrard opened this issue · comments

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 😢

Hey @jonsherrard,

It sounds like it's not finding the intervention.php file, are you using Sage 9/10?

Hi @darrenjacoby I am not, is it required? 😬

Nope it's not, it would just read from either resources/ or config/ if you were. Intervention uses the WordPress function get_stylesheet_directory(), what does that return for you if you run it somewhere in your code?

Hi @darrenjacoby,

I've figured it out. Installing with composer require defaults to version 1.3, which wasn't working. Discovered this when I searched the installed plugin for get_stylesheet_directory and it wasn't there.

Updated my composer to install directly from the master branch and everything's working perfectly 👍

Ah right, that's an easy oversight. I need to tag 2.0.0, but been working on a few extra things for the release.

Thanks for your help! Amazing project too.

@jonsherrard, thanks so much for the beers! It was so unexpected and made my day. 🍻🍻🍻