Skip to content

Instantly share code, notes, and snippets.

View thuijssoon's full-sized avatar

Thijs Huijssoon thuijssoon

  • The Netherlands
View GitHub Profile
@thuijssoon
thuijssoon / disableBodyScroll.js
Last active November 2, 2023 18:55
iOS disable body scroll
/**
* 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;}
*
UPDATE `wp_postmeta`
SET `meta_value` = REPLACE(`meta_value`, 'http:', 'https:')
WHERE `meta_key` = 'book_review_cover_url' AND `meta_value` LIKE ('http:%');
/**
* 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();