View example.php
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 | |
// Create fake resource | |
$resource = new \StdClass(); | |
$resource->card = new \StdClass(); | |
$resource->card->id = 1; | |
$resource->card->last4 = '3333'; | |
$resource->card->exp_year = '2019'; | |
$resource->card->exp_month = '01'; | |
$resource->card->brand = 'mastercard'; |
View cron-mu-cli.sh
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
#!/usr/bin/env bash | |
if [ -z "$1" ] | |
then | |
echo "You need to pass the url of the site. Usage ./cron-mu-cli.php http://mysite.fr" | |
exit | |
fi | |
for url in $( wp site list --field=url --url=$1 ) | |
do |
View postmessage.js
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 origin = null; | |
if(window.addEventListener) { | |
window.addEventListener('message', onMessage, false); | |
} else { | |
window.attachEvent('onmessage', onMessage); | |
} | |
function onMessage(e) { | |
if(referer !== undefined && e.origin === referer) { |
View filter.php
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 | |
add_filter( 'SIS/Admin/Post/Display_Thumbnail_Regenerate', '__return_false' ); |
View class-terms-fields.php
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 ACF_Terms_Fields | |
* @version 1.1.0 | |
* | |
* Fill all the taxonomy terms with ACF metas | |
*/ | |
class ACF_Terms_Fields { | |
/** |
View search-filter.php
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 custom_search_query( $query ) { | |
if( is_admin() && $query->is_main_query() && $query->query['post_type'] === 'revendeurs' && isset($query->query_vars['s']) ) | |
{ | |
$custom_fields = array( | |
// put all the meta fields you want to search for here | |
"raison_sociale", | |
); | |
$searchterm = $query->query_vars['s']; |
View shortcode-album.php
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 | |
/* | |
Plugin Name: Album shortcode | |
Version: 0.1 | |
Description: Un shortcode pour afficher un album | |
*/ | |
// don't load directly | |
if ( !defined('ABSPATH') ) | |
die('-1'); |
View shortcode-album.php
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 | |
/* | |
Plugin Name: Album shortcode | |
Version: 0.1 | |
Description: Un shortcode pour afficher un album | |
*/ | |
// don't load directly | |
if ( !defined('ABSPATH') ) | |
die('-1'); |
View shortcode-album.php
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 | |
/* | |
Plugin Name: Album shortcode | |
Version: 0.1 | |
Description: Un shortcode pour afficher un album | |
*/ | |
// don't load directly | |
if ( !defined('ABSPATH') ) | |
die('-1'); |
View shortcode-album.php
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 | |
/* | |
Plugin Name: Album shortcode | |
Version: 0.1 | |
Description: Un shortcode pour afficher un album | |
*/ | |
// don't load directly | |
if ( !defined('ABSPATH') ) | |
die('-1'); |
NewerOlder