Skip to content

Instantly share code, notes, and snippets.

@bdgeorge
bdgeorge / gist:1997786
Created March 8, 2012 01:18
The _fix_attachment_links function from wordpress 2.8 - fixes attachment link problems
<?php
function _fix_attachment_links( $post_ID ) {
$post = & get_post( $post_ID, ARRAY_A );
$search = "#<a[^>]+rel=('|\")[^'\"]*attachment[^>]*>#ie";
// See if we have any rel="attachment" links
if ( 0 == preg_match_all( $search, $post['post_content'], $anchor_matches, PREG_PATTERN_ORDER ) )
return;
@bdgeorge
bdgeorge / gist:2027795
Created March 13, 2012 09:21
Mockup of advanced controls
<?php
/**
* Netzarbeiter
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
@bdgeorge
bdgeorge / gist:0af8c147b4a8775d7cf6
Last active August 29, 2015 14:19
Eway subsription bug with Woocommerce

#Woocommerce Eway bug test

This bug has two parts that may or may not be related.

First any subscription orders made using Eway create token customers with their country set to "Afghanistan".

This is incorrect and may be triggering a second much more serious error when subscription's fail and need to be renewed.

When their credit card eventually expires or fails due to some other reason (eg insufficient funds) on the next recurrence of their subscription it will fail. The invoice that gets generated doesn't carry a valid payment method, instead it displays the error to the customer no available payment methods for your state