This file contains 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
/** | |
* Programmatically logs a user in | |
* | |
* @param string $username | |
* @return bool True if the login was successful; false if it wasn't | |
*/ | |
function programmatic_login( $username ) { | |
if ( is_user_logged_in() ) { | |
wp_logout(); |
This file contains 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
UPDATE `wp_postmeta` | |
SET `meta_value` = REPLACE(`meta_value`, 'http:', 'https:') | |
WHERE `meta_key` = 'book_review_cover_url' AND `meta_value` LIKE ('http:%'); |
This file contains 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
/** | |
* Prevent body scroll and overscroll. | |
* Tested on mac, iOS chrome / Safari, Android Chrome. | |
* | |
* Based on: https://benfrain.com/preventing-body-scroll-for-modals-in-ios/ | |
* https://stackoverflow.com/a/41601290 | |
* | |
* Use in combination with: | |
* html, body {overflow: hidden;} | |
* |