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
var proto = Element.prototype; | |
var slice = Function.call.bind(Array.prototype.slice); | |
var matches = Function.call.bind(proto.matchesSelector || | |
proto.mozMatchesSelector || proto.webkitMatchesSelector || | |
proto.msMatchesSelector || proto.oMatchesSelector); | |
// Returns true if a DOM Element matches a cssRule | |
var elementMatchCSSRule = function(element, cssRule) { | |
return matches(element, cssRule.selectorText); | |
}; |
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
############ WordPress #################### | |
# Disable logging for favicon and robots.txt | |
location = /favicon.ico { | |
try_files /favicon.ico @empty; | |
access_log off; | |
log_not_found off; | |
expires max; | |
} |
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
global $wp_styles; | |
$styles = ( new Arrayy( $wp_styles->registered ) ) | |
->map( function ( $style ) { | |
return [ | |
'src' => $style->src, | |
'handle' => $style->handle, | |
]; | |
} ) | |
->toArray(); |
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
add_action( 'wp', function () { | |
if ( ! isset( $_GET['test-add-product-categories-fr'] ) ) { | |
return; | |
} | |
$categories = [ | |
'Climatiseur' => [ | |
'args' => [ | |
'parent' => 0, | |
], |
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
sudo apt update | |
sudo add-apt-repository ppa:certbot/certbot | |
sudo apt install python-certbot-nginx | |
sudo certbot --nginx -d example.com | |
sudo certbot renew --dry-run | |
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
add_action( 'wp_enqueue_scripts', function() { | |
$wp_upload_dir = wp_upload_dir(); | |
$base_url = $wp_upload_dir['baseurl']; | |
$base_dir = $wp_upload_dir['basedir']; | |
wp_enqueue_style( | |
'howlife-style', | |
sprintf( '%s/example/css/main.css', $base_url ), | |
[], | |
filemtime( sprintf( '%s/howlife/css/main.css', $base_dir ) ) |
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
add_action( 'wp', function () { | |
$posts = get_posts( | |
[ | |
'post_type' => 'post', | |
'lang' => '', | |
'paged' => 1, | |
'posts_per_page' => - 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
add_action( 'wp_enqueue_scripts', function() { | |
$wp_upload_dir = wp_upload_dir(); | |
$base_url = $wp_upload_dir['baseurl']; | |
$base_dir = $wp_upload_dir['basedir']; | |
wp_enqueue_style( | |
'howlife-style', | |
sprintf( '%s/example/css/main.css', $base_url ), | |
[], | |
filemtime( sprintf( '%s/example/css/main.css', $base_dir ) ) |
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
window.resize = (function () { | |
'use strict'; | |
function Resize() {} | |
Resize.prototype = { | |
init: function(outputQuality) { | |
this.outputQuality = (outputQuality === 'undefined' ? 0.8 : outputQuality); | |
}, |
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
$plugin_path = plugin_dir_path( __DIR__ ); | |
$template_path = sprintf( '%stemplate-parts/header/navbar-primary.php', $plugin_path ); | |
include $template_path; |
NewerOlder