Snippets

Visser Labs Strip Shortcodes and Visual Composer markup from the Order Items: Description export field

Created by Michael Visser last modified
<?php
function custom_woo_ce_get_order_items( $order_items, $order_id ) {

	foreach( $order_items as $key => $order_item ) {
		// Remove WordPress shortcodes from Order Items: Description
		$order_items[$key]->description = strip_shortcodes( $order_item->description );
		// Remove Visual Composer markup from Order Items: Description
		$order_items[$key]->description = preg_replace("~(?:\[/?)[^/\]]+/?\]~s", '', $order_item->description );
	}	
	
	return $order_items;

}
add_filter( 'woo_ce_get_order_items', 'custom_woo_ce_get_order_items', 10, 2 );
?>

Comments (0)