Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
/**
* Prevent revslider from adding a query on every request.
*
* Calling `update_option('rs_tables_created', true)` causes
* a database query to run since it's get_option value ("1")
* does not match the value it is called to set it to.
*
* Since the query casts `true` to "1" the update query is run on every request as true !== '1'.
*
* This fixes the issue by casting the return value of get_option to a boolean.
*
* @see \RevSliderFront::createDBTables
*/
add_filter('option_rs_tables_created', 'boolval');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment