Skip to content

Instantly share code, notes, and snippets.

@aaemnnosttv
Created June 5, 2018 12:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaemnnosttv/180a18456ab9b65d52813ad5f6688a05 to your computer and use it in GitHub Desktop.
Save aaemnnosttv/180a18456ab9b65d52813ad5f6688a05 to your computer and use it in GitHub Desktop.
<?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