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
<script> | |
(function ($) { | |
// TODO: Adjust the following to lines to your needs: | |
var popup = 'contact'; // Your Popup ID. | |
var distance = 500; // Scroll distance [pixel]. | |
$(window).on('scroll.popup_' + popup, function () { | |
// Check if the user scrolled far enough. |
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
<?php | |
/** | |
* How to use this snippet: | |
* | |
* 1. Click the "Download ZIP" button (top-right area) | |
* 2. Open wp-admin > Plugins > Add New | |
* 3. Click "Upload Plugin" and select the zip file | |
* 4. After uploading the zip file, activate the plugin | |
* | |
* ---------- |
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
/** | |
* Option 1: | |
* Open an existing Popup and change the URL of an iframe inside the Popup. | |
* | |
* Preparation: | |
* Create a Divi Area (or an On-Page Popup) which contains an iframe. | |
* | |
* @param {string} areaId - The ID of an existing Popup or Divi Area. | |
* @param {string} iframeUrl - The new URL of the iframe inside the Popup. | |
*/ |
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
<?php | |
/** | |
* Proof of concept for https://github.com/divimode/gdpr-cache-script-styles | |
*/ | |
/** | |
* Filter all scripts and style URLs. | |
* When an external URL is detected, download the file | |
* and replace it in the page source. |
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
<?php | |
/** | |
* Plugin Name: Divi Areas Pro - Local GSAP library | |
* Plugin URI: https://gist.github.com/stracker-phil/00b9a53632b93574c10aec491bcde586 | |
* Description: Embed the GSAP animation library on the local website to comply with GDPR/privacy rules. | |
* | |
* --------- | |
* | |
* How to use this gist: | |
* 1. Download the gist as ZIP file |
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
/** | |
* Scans all CSS rules in the current document to find the most | |
* specific definiton of a single CSS property for a given element. | |
* | |
* Usage: getStyleDef('#my-element', 'width'); | |
* --> returns the most specific "width" defintiion, e.g. "27em". | |
* | |
* @param {HTMLElement} element - The HTML Element to inspect. | |
* @param {string} prop - The CSS property to inspect. | |
* @return {string} The most specific CSS definition, |
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
<?php | |
/** | |
* Passwordless login for development environments. | |
* | |
* Setup: | |
* 1. Make sure that the "wp-contents/mu-plugins" folder exists. Create it if needed. | |
* 2. Save this file as "wp-contents/mu-plugins/wp-dev-login.php" | |
* 3. Check the conditions in line 29 - 30 and adjust them to your requirements. | |
* | |
* Once installed, all default WP login forms will display a dropdown list of all |
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
<?php | |
/** | |
******************************************************************************* | |
* Log in with any password. You only need to know the username or email address. | |
* | |
* How to use it: | |
* | |
* 1. Save this code to wp-content/mu-plugins/auto-login.php | |
* 2. Now go to wp-login.php and enter a valid username together with any | |
* password. The password is not validated, only the username must exist. |
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
// Detects the browser locale for Date translations. | |
const locale = (navigator.languages && navigator.languages.length) ? | |
navigator.languages[0] : | |
navigator.language ? | |
navigator.language : | |
'en'; | |
// Date formatter with php-compatible format syntax | |
export const formatDate = (format, date) => { | |
if (format === undefined) { |
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
<?php | |
add_filter( 'evr_divi_popup-js_data', 'my_divi_popup_options' ); | |
function my_divi_popup_options( $config ) { | |
// -- Modify UI of popups -- | |
/** | |
* The base z-index. This z-index is used for the overlay, every | |
* popup has a z-index increased by 1: |