Skip to content

Instantly share code, notes, and snippets.

View thomascharbit's full-sized avatar

Thomas Charbit thomascharbit

View GitHub Profile
<?php var_dump($this->getData()); ?>
<?php $item = $block->getItem(); ?>
<?php $order = $block->getOrder(); ?>
<?php $orderItem = $item->getOrderItem(); ?>
<tr>
<td style="vertical-align: top;<?= $orderItem->getParentItemId() ? 'padding: 0px 20px 5px 10px;' : 'padding: 10px 20px 5px 0;' ?>">
<div style="<?= $orderItem->getParentItemId() ? '' : "font-family: 'josefinsans', sans-serif; font-size: 14px; font-weight: bold; text-transform: lowercase; letter-spacing: .2em;" ?>">
<?= $block->escapeHtml($item->getName()); ?>
</div>
<?php if ($productOptions = $block->getProductOptions($item)) : ?>
diff --git a/ext/intl/breakiterator/codepointiterator_internal.cpp b/ext/intl/breakiterator/codepointiterator_internal.cpp
index 723cfd5022..f6f75d2731 100644
--- a/ext/intl/breakiterator/codepointiterator_internal.cpp
+++ b/ext/intl/breakiterator/codepointiterator_internal.cpp
@@ -74,7 +74,11 @@ CodePointBreakIterator::~CodePointBreakIterator()
clearCurrentCharIter();
}
+#if U_ICU_VERSION_MAJOR_NUM >= 70
+bool CodePointBreakIterator::operator==(const BreakIterator& that) const
//
// _oo0oo_
// o8888888o
// 88" . "88
// (| -_- |)
// 0\ = /0
// ___/`---'\___
// .' \\| |// '.
// / \\||| : |||// \
// / _||||| -:- |||||- \
<?php
/**
* An alternative to the native WP function `get_template_part` that
* can pass arguments to the local scpoe
*
* @param string $slug The slug name for the generic template.
* @param string $name The name of the specialised template.
* @param array $args The arguments to pass to this file. Optional.
* @param bool $echo Wether to echo or return the rendered template. Default to true.
@thomascharbit
thomascharbit / elasticpress-mlt.php
Created July 7, 2015 08:55
Find related posts with Elasticpress
<?php
add_filter('ep_formatted_args', 'my_ep_formatted_args', 10, 2 );
function my_ep_formatted_args( $formatted_args, $args ) {
// Handle more like this queries. WP_QUery arg formatting is: array( 'more_like' => $post_id )
if ( ! empty( $args['more_like'] ) ) {
$formatted_args['query'] = array(
'more_like_this' => array(

PHP en ligne de commande sur les hébergements mutualisés OVH

PHP-CLI

/usr/local/php5.3/bin/php   => PHP 5.3.28 (cli) (built: Sep  2 2014 09:30:31)
/usr/local/php5.4/bin/php   => PHP 5.4.30 (cli) (built: Sep  2 2014 09:29:35)
/usr/local/php5.5/bin/php   => PHP 5.5.14 (cli) (built: Sep  2 2014 09:30:07)
/usr/local/php5.6/bin/php   => PHP 5.6.0 (cli) (built: Sep  2 2014 09:30:26)
@thomascharbit
thomascharbit / acf-sync.php
Created October 1, 2014 18:26
ACF field groups sync for developers
<?php
define( 'ACF_FIELDS_VERSION', '1.0.1');
if ( 'development' == WP_ENV ) {
// save fields to JSON
add_filter('acf/settings/save_json', 'lc_json_save_point');