• acaballerog

    (@acaballerog)


    This plugin has been a must for a while now, i tiny clever idea that saves a lot of job on managing complex sites.

    That’s why I was worried when it just stopped working. Today I could finally have a look at it and realized it’s probably not working since the release of 3.0.

    As noted on this topic, $GLOBALS['pagenow'] is not available when the Filter_Page_By_Template class is initialized. After the fix from that topic, there’s no php warning but neither anything else happens because $GLOBALS['pagenow'] is null.

    I’ve been trying to fix it and it looks like the class instantiation must be done into a hook. Otherwise $GLOBALS['pagenow'] is not available.

    add_action('init',function(){
       new Filter_Page_By_Template();
    });

    This worked for me. But maybe it’s not the most appropriate hook. I’m not an expert on the topic. wp_loaded worked as well.

Viewing 1 replies (of 1 total)
  • Thread Starter acaballerog

    (@acaballerog)

    [update] It only happens on multisite installations. Tested it on a brand new installation with 6.1.1 version, theme twenty twenty two and no other plugins active.

Viewing 1 replies (of 1 total)
  • The topic ‘Filter not working since 3.0’ is closed to new replies.