Skip to content

Instantly share code, notes, and snippets.

View tribulant's full-sized avatar

Tribulant tribulant

View GitHub Profile
@tribulant
tribulant / gist:8ef6963f267bf303898e
Created August 12, 2014 13:37
Checkout: Filter - checkout_processing_output Usage
<?php
add_filter('checkout_processing_output', 'processing_output', 10, 2);
?>
@tribulant
tribulant / gist:67cc565e4d42537ea321
Created August 12, 2014 13:38
Checkout: Filter - checkout_processing_output Example
<?php
// Change the "Processing Order..." output on the payment page of the checkout procedure
function processing_output($html = null, $pmethod = null) {
// Change $html here as needed
$html = 'New text or html for the payment page...';
return $html;
}
<?php
global $post;
$post_id = $post -> ID;
if (function_exists('wpco_is_category')) {
if ($category = wpco_is_category($post_id)) {
// then based on category ID, you can do something...
if ($category -> id == X) {
echo 'This is some text/html to show on the category page';
<?php
$data = array(
'email' => $_POST['email'],
'list_id' => array(1,2),
'mailinglists' => array(1,2),
'firstname' => $firstname, //$firstname variable contains the Prenom
);
?>
@tribulant
tribulant / gist:20fb9934d84599c4ef57
Created August 25, 2014 10:20
Latest Posts Email Template
<div class="wpmlposts">
[newsletters_post_loop]
<h2>[newsletters_category_heading]</h2>
<div class="wpmlpost">
<h3><a href="[newsletters_post_link]" title="[newsletters_post_title]">[newsletters_post_title]</a></h3>
[newsletters_post_date_wrapper]<p><small>Posted on [newsletters_post_date format="F jS, Y"] by [newsletters_post_author]</small></p>[/newsletters_post_date_wrapper]
<div class="wpmlpost_content">
[newsletters_post_thumbnail]
<p>[newsletters_post_excerpt]</p>
</div>
@tribulant
tribulant / gist:824d4b30f357b034cadd
Created August 29, 2014 10:09
Hide newslettername field
.newslettername-wrapper {
display: none;
}
@tribulant
tribulant / gist:ab2aef79001a3f8e051b
Created September 12, 2014 09:21
Newsletters: Filter - newsletters_emailbody_links Usage
<?php add_filter('newsletters_emailbody_links', 'emailbody_links', 10, 3); ?>
@tribulant
tribulant / gist:56ead454c9dc1a8997eb
Created September 12, 2014 09:26
Newsletters: Filter - newsletters_emailbody_links Example
<?php
function emailbody_links($body = null, $history_id = null, $matches = null) {
global $Html;
if (!empty($matches)) {
foreach ($matches[1] as $key => $value) {
$pattern = '/[\'"](' . preg_quote($value, '/') . ')[\'"]/si';
$newlink = $Html -> retainquery('param1=value1', $value);
$body = preg_replace($pattern, '"' . $newlink . '"', $body);
@tribulant
tribulant / gist:c0e9269a941f809f4e89
Created September 12, 2014 09:36
Newsletters: Filter - wpml_send_body Usage
<?php add_filter('wpml_send_body', 'myfunc_send_body', 10, 3); ?>
@tribulant
tribulant / gist:a0a858de93f37cbbee42
Created September 12, 2014 09:37
Newsletters: Filter - wpml_send_body Example
<?php
add_filter('wpml_send_body', 'myfunc_send_body', 10, 3);
function myfunc_send_body($body = null, $phpmailer = null, $history_id = null) {
// Do something with the body/content here...
// For example, strip the HTML from it and assign it as the alternative body
$phpmailer -> AltBody = strip_tags($body);
// Or append something to it like social media icons at the end
$body .= '<div>Social media HTML</div>';