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
/* Resize the iframe on request. */ | |
if ( 'height' === data.message ) { | |
height = parseInt( data.value, 10 ); | |
if ( height > 1000 ) { | |
height = 1000; | |
} else if ( ~~height < 200 ) { | |
height = 200; | |
} |
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', 'child_theme_enqueue_scripts', PHP_INT_MAX); | |
function child_theme_enqueue_scripts() { | |
wp_enqueue_script('iframe-script', get_stylesheet_directory_uri() . '/js/iframe.js', ['jquery'], uniqid(), true); | |
} |
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
/** | |
* Overwrite/bypass <iframe></iframe> height limit imposed by Wordpress | |
* Original idea from bypass-iframe-height-limit plugin by Justin Carboneau | |
* Adapted from original /wp-includes/js/wp-embed.js | |
*/ | |
(function(window, document) { | |
'use strict'; | |
var supportedBrowser = false; |
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
<IfModule mod_deflate.c> | |
AddOutputFilterByType DEFLATE text/plain | |
AddOutputFilterByType DEFLATE text/javascript | |
AddOutputFilterByType DEFLATE text/html | |
AddOutputFilterByType DEFLATE text/xml | |
AddOutputFilterByType DEFLATE text/css | |
AddOutputFilterByType DEFLATE text/vtt | |
AddOutputFilterByType DEFLATE text/x-component | |
AddOutputFilterByType DEFLATE application/xml | |
AddOutputFilterByType DEFLATE application/xhtml+xml |
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 | |
class StringHelper | |
{ | |
/** | |
* Compare an associative multidimensionnal array by specific object value | |
* | |
* @param array &$array Reference of the array we want to sort | |
* @param string $element Element from which we want to order by specific key from |
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 | |
require "StringHelper.php"; | |
$helper = new StringHelper(); | |
$categories = []; | |
$news = new stdClass(); | |
$news->names = ["fr" => "Actualités", "en" => "News"]; | |
$categories[] = $news; |
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 | |
use PhpCsFixer\Config; | |
use PhpCsFixer\Finder; | |
$rules = [ | |
'array_syntax' => ['syntax' => 'short'], | |
'binary_operator_spaces' => [ | |
'default' => 'single_space', | |
'operators' => ['=>' => 'align_single_space_minimal'], |