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
function ajouter_raccourci_js() { | |
if (is_user_logged_in() && current_user_can('edit_posts')) { // Vérifie que l’utilisateur est connecté et a les droits d’édition | |
?> | |
<script> | |
document.addEventListener("keydown", function(event) { | |
if (event.ctrlKey && event.key === "e") { | |
event.preventDefault(); // Empêche toute action par défaut | |
let editLink = document.querySelector("a[href*='action=edit']"); | |
if (editLink) { | |
window.location.href = editLink.href; // Redirige vers l'éditeur |
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 | |
defined('BASEPATH') OR exit('No direct script access allowed'); | |
class MY_Input extends CI_Input { | |
/** | |
* Instance de CI_Security | |
* | |
* @var CI_Security | |
*/ |
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 block_get_refreshed_fragments_for_specific_bots() { | |
// Vérifie si la requête est celle de WooCommerce pour les fragments | |
if (isset($_REQUEST['wc-ajax']) && $_REQUEST['wc-ajax'] === 'get_refreshed_fragments') { | |
// Liste des patterns pour les user agents à bloquer (exemples) | |
$bot_patterns = array( | |
' YLT', | |
'^Aether', | |
'^Amazon Simple Notification Service Agent$', |
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
/* | |
* Permet de rendre une checkbox obligatoire parmis plusieurs | |
* | |
* Jquery required. | |
* | |
* <input name="tranche[]" type="checkbox" class="tel-checkbox" id="modal-usual-call-matin" value="matin" required> | |
* <input name="tranche[]" type="checkbox" class="tel-checkbox" id="modal-usual-call-midi" value="midi" required> | |
* <input name="tranche[]" type="checkbox" class="tel-checkbox" id="modal-usual-call-apmidi" value="apres-midi" required> | |
* <input name="tranche[]" type="checkbox" class="tel-checkbox" id="modal-usual-call-soir" value="soir" required> | |
* |
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
function add_loading_lazy_to_images($attr) { | |
$attr['loading'] = 'lazy'; | |
return $attr; | |
} | |
add_filter( 'wp_get_attachment_image_attributes', 'add_loading_lazy_to_images'); |
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 | |
session_start() ; | |
$cmd1 = 'python -u /var/www/blabla/test/Test.py'; | |
$proc=proc_open($cmd1, | |
array( | |
array("pipe","r"), | |
array("pipe","w"), | |
array("pipe","w") | |
), |
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
jQuery(document).ready(function($) | |
{ | |
function CopyPasta() | |
{ | |
var commentaire = " : coucou : "; | |
var url = window.location.href; | |
var copy = window.getSelection(); | |
var brut = copy.toString(); | |
var divPaste = document.createElement('div'); |
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
function getUrlParam(name) { | |
var results = new RegExp('[\\?&]' + name + '=([^]*)').exec(window.location.href); | |
return (results && results[1]) || 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 | |
if ( ! function_exists('isLundi')) | |
{ | |
function isLundi($date = FALSE) { | |
if($date === FALSE) | |
{ | |
return (date('N', strtotime(date("Y-m-d H:i:s"))) == 1); | |
} | |
return (date('N', strtotime($date)) == 1); | |
} |
NewerOlder