I hereby claim:
- I am em-piguet on github.
- I am empiguet (https://keybase.io/empiguet) on keybase.
- I have a public key ASAPEZYVo58aN6f9tnXqg6SHBB-l2-NagjS7Pq1gwPkfqAo
To claim this, I am signing this object:
<?php | |
function get_youtube_video_ID($youtube_video_url) { | |
/** | |
* Pattern matches | |
* http://youtu.be/ID | |
* http://www.youtube.com/embed/ID | |
* http://www.youtube.com/watch?v=ID | |
* http://www.youtube.com/?v=ID | |
* http://www.youtube.com/v/ID | |
* http://www.youtube.com/e/ID |
<?php | |
function acces_article_offert() | |
{ | |
// only on post | |
if (is_singular('post')) { | |
// get the gift start date | |
$date_de_debut = get_field('article_gift'); | |
if ($date_de_debut) { | |
$date_de_fin = date('Y-m-d', strtotime($date_de_debut . ' + 7 days')); |
<?php | |
/* | |
* ADD OEMBED TO RTS.CH | |
* Copied from : https://gist.github.com/marcwieland95/61074b488aae12460a17882aeb3e0fd8 | |
*/ | |
wp_embed_register_handler('srg', '#https?:\/\/(?:www\.)?(srf|rsi|rts|rtr)\.ch\/.*(?:detail\/|video:)((?:.{8}-.{4}-.{4}-.{4}-.{12})|\d*)(?:.startTime=(\d*)|.*)#i', function ($matches, $attr, $url, $rawattr) { | |
return sprintf( | |
'<div class="embed-container"><iframe width="560" height="315" src="https://%1$s.ch/play/embed?urn=urn:%1$s:video:%2$s" allowfullscreen allow="encrypted-media"></iframe></div>', | |
esc_attr($matches[1]), | |
esc_attr($matches[2]), |
#!/bin/bash | |
################################################ | |
## | |
## Update CIVI plugin in Wordpress | |
## | |
## this script is called via | |
## $ ssh [email protected] 'bash -s -- sites/folder 5.41.0 SiteName' < civi-update.sh | |
## | |
################################################ |
I hereby claim:
To claim this, I am signing this object:
<?php | |
/** | |
* This is a muplugin | |
* | |
* Indexation des champs ACF "Auteurs" (relationnel) et "Année" (post_date) dans Elasticsearch index | |
* pour WPSOLR | |
*/ | |
use wpsolr\core\classes\WPSOLR_Events; |
<?php | |
//////////////////////////////////////////// | |
// Manage WooCommerce styles and scripts. // | |
//////////////////////////////////////////// | |
function woocommerce_script_cleaner() { | |
// Remove the generator tag | |
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) ); | |
// remove definitly, no need of this one | |
/////////////////////////////////////////////////// |
<?php | |
/** | |
* Ajoute un tab/endpoints dans la partie mon compte | |
* https://nicola.blog/2017/08/01/add-enquiry-form-my-account-woocommerce-contact-form-7/ | |
* | |
*/ | |
class WC_Custom_My_Account_Tabs extends WC_Query { | |
/** | |
* Adds main filters and actions and inits the endpoints. |
<?php | |
/* | |
* Returns true if we are working on a development server, determined by server's | |
* hostname. Will generate an error if run on an unknown host. | |
*/ | |
function isdev() | |
{ | |
$isdev = null; | |
// don't run function body more than once |
<?php | |
function show_current_template($wp_admin_bar) | |
{ | |
global $template; | |
$args = array( | |
'id' => 'current_template', | |
'title' => basename($template), | |
'meta' => array('title' => $template), | |
); | |
$wp_admin_bar->add_node($args); |