// Leaflet JS - note the *className* attribute
// [...]
L.tileLayer('https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png', {
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
className: 'map-tiles'
}).addTo(map);
// [...]
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
#!/bin/bash | |
# This script downloads the actual list of CloudFlare's IPv4/6 ranges | |
# and allows them to connect to the 443 port (HTTPS) and drops | |
# connections from other addresses. | |
# This is to prevent DDoS attacks and attackers from using the "Host" | |
# header to identify your server backend address. | |
# download the lists and remove the trailing newline | |
ranges4=$(curl -s https://www.cloudflare.com/ips-v4 | head -c -1) | |
ranges6=$(curl -s https://www.cloudflare.com/ips-v6 | head -c -1) |
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 | |
/* | |
* ----------------------------------------------------------------------------- | |
* Advanced Custom Fields Modifications | |
* ----------------------------------------------------------------------------- | |
*/ | |
function PREFIX_apply_acf_modifications() { | |
?> | |
<style> |
I had difficulty installing WP-CLI properly on my WebFaction server because of the inability to use the sudo command to move the .phar file to the proper wp directory. The WebFaction support team was helpful as usual with some good instructions.
- Log in to your WebFaction account via SSH: https://docs.webfaction.com/user-guide/access.html
- Run the following command on the root directory:
curl -so ~/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
It's probably a good idea to check the download URL there with the official WP-CLI installation instructions to make sure it hasn't changed. - Run the following command:
chmod u+x ~/bin/wp
- Check to make sure it's installed correctly with
wp --info
.
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 | |
function wpmu_change_theme_on_all_subsites(){ | |
global $switched; | |
$theme_directory_slug = 'twentyfourteen'; | |
$sites = wp_get_sites( $args ); | |
if($sites){ |
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
/** | |
* Filter Gravity Forms select field display to wrap optgroups where defined | |
* USE: | |
* set the value of the select option to `optgroup` within the form editor. The | |
* filter will then automagically wrap the options following until the start of | |
* the next option group | |
*/ | |
add_filter( 'gform_field_content', 'filter_gf_select_optgroup', 10, 2 ); | |
function filter_gf_select_optgroup( $input, $field ) { |
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 if (!defined('ABSPATH')) die('Restricted Area'); | |
/* | |
* Plugin Name: Disable Yoast SEO Notifications | |
* Description: Hide annoying notifications after each upgrade of Yoast SEO plugin and others admin notices. | |
* Version: 1.1 | |
* Author: Aurélien Denis | |
* Author URI: https://wpchannel.com/ | |
*/ |
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
$gravity_form_id = 6; // gravity form id, or replace {$gravity_form_id} below with this number | |
add_filter("gform_after_submission_{$gravity_form_id}", 'jdn_set_post_acf_gallery_field', 10, 2); | |
function jdn_set_post_acf_gallery_field($entry, $form) | |
{ | |
$gf_images_field_id = 42; // the upload field id | |
$acf_field_id = 'field_54804833b3067'; // the acf gallery field id | |
// get post |
##Sass Functions Cheat Sheet
These steps should have been mentioned in the prerequisites of the Laravel Installation Guide, since I'm surely not the only person trying to get Laravel running on macOS.
Install Mcrypt using Homebrew and PECL (comes with PHP)
# PHP 7.3
NewerOlder