Load order gets messed up and ignoring functions.php
-
Your plugin causes load order issues when activated. To replicate:
1. have a plugin with a get function that returns an array with data and a simple filter function for that data. For example an array with post types that you want to register
2. Create a filter in the theme functions and extend or alter that array.
3. Run a function in the plugin on the ‘init’ hook that registers those post types.
4. Trigger a few get requests on different positions of the page load to access your array of post types before and after your own plugin loads
This will work if your get function executes the filter every time its get called.
BUT if you cache the first execution of the get function and the filters inside it your data will no longer get extended by the theme.
This is a big issue for themes in need of modifying data and where the plugins are caching their data after first execution.Deactivating your plugin solves the issue and accepts theme functions filters to modify even the first get call and therefor returns the correct data even when cached
The page I need help with: [log in to see the link]
- The topic ‘Load order gets messed up and ignoring functions.php’ is closed to new replies.