Allow TB to be loaded with a filter
-
Problem: Tablepress is not loaded if on the login page.
Solution: In the class-tablepress.php file, in the run() function, instead of the “Exit early” return function, add a filter.
Instead of
if ( ( 'wp-login.php' === basename( $_SERVER['SCRIPT_FILENAME'] ) ) // Login screen || ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST ) || ( defined( 'DOING_CRON' ) && DOING_CRON ) ) { return; }
Perhaps
$load_tablepress = true; if ( ( 'wp-login.php' === basename( $_SERVER['SCRIPT_FILENAME'] ) ) // Login screen || ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST ) || ( defined( 'DOING_CRON' ) && DOING_CRON ) ) { $load_tablepress = false; } $load_tablepress = apply_filters( 'tablepress_should_load', $load_tablepress ); if ( ! $load_tablepress ) return;
Why the problem: My plugin, Broadcast, distributes posts across sites in a WP network install, modifying tablepress shortcodes automatically.
When broadcasting in the background, the queue add-on processes using the login URL.
The login URL does not allow TablePress to load.
No loading = unable to find the equivalent table ID for each site.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Allow TB to be loaded with a filter’ is closed to new replies.