Filter not working since 3.0
-
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']
isnull
.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.
- The topic ‘Filter not working since 3.0’ is closed to new replies.