wp-logging icon indicating copy to clipboard operation
wp-logging copied to clipboard

Redux Framework Integration

Open emcniece opened this issue 11 years ago • 2 comments

I'm having a bit of trouble integrating this with Redux Framework, a theme/plugin options interface. I've included the WP_Logging.php file before the Redux include, and I would like to display a tab within Redux for displaying logs. However, when I call WP_Logging::get_connected_logs() from within a raw field in Redux, either I pass a log_type argument and get nothing, or I don't use a log_type and get everything.

Part of this problem is due to the init hook sequence of Redux - in order to make WP-Logging work in Redux, I have to make a new WP_Query() object before calling WP_Logging::get_connected_logs() - otherwise, no initialized query exists and the call returns nothing.

This also applies in some form to the log_type parameter - since it's a taxonomy query, it fails with an "Invalid Taxonomy" error.

Redux options are initialized on the redux/loaded action. If this is changed to init or wp_head, the WP_Logging calls work perfectly fine... but the Redux options are blown away.

My current thought is to let everything load independent from Redux, then make an Ajax call and populate the raw field with the error logs after window load, allowing the WP_Logging queries to execute in their own request and in the correct hook order.

Anybody else have any thoughts on how to make this work?

emcniece avatar Apr 11 '14 15:04 emcniece

Interesting. Perhaps @ghost1227 could lend some thoughts.

pippinsplugins avatar Apr 11 '14 19:04 pippinsplugins