fallback for bad calls to the post_class filter. Closes #3463

This commit is contained in:
Mike Jolley 2013-07-19 14:28:04 +01:00
parent b01bf72bfe
commit 857ed79924
1 changed files with 4 additions and 1 deletions

View File

@ -13,7 +13,10 @@ class WC_Post_Class_Helper extends WC_Helper {
* @param int $post_id
* @return array
*/
public function post_class( $classes, $class, $post_id ) {
public function post_class( $classes, $class = '', $post_id = '' ) {
if ( ! $post_id )
return $classes;
$product = get_product( $post_id );
if ( $product ) {