Created
June 5, 2018 12:39
-
-
Save aaemnnosttv/180a18456ab9b65d52813ad5f6688a05 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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