I am receiving Warnings when trying to use some arguments in a filter hook.
WARNING: MISSING ARGUMENT 2 FOR UPDATE_SALE() IN C:\WAMP\WWW\FRANK\WP-CONTENT\THEMES\TWENTYTHIRTEEN\FUNCTIONS.PHP ON LINE 688
WARNING: MISSING ARGUMENT 3 FOR UPDATE_SALE() IN C:\WAMP\WWW\FRANK\WP-CONTENT\THEMES\TWENTYTHIRTEEN\FUNCTIONS.PHP ON LINE 688
Here is the signature of the filter I am trying to hook into
echo apply_filters(
'woocommerce_sale_flash',
'<span class="onsale">'.__( 'Sale!', 'woocommerce' ).'</span>',
$post,
$product);
Here is my custom filter action
function update_sale( $content, $post, $product ) {
$content = '<span class="onsale">'.__( '25% Off!', 'woocommerce' ).'</span>';
return $content;
}
add_filter('woocommerce_sale_flash', 'update_sale');
When I include the additional arguments $post, and $product in my function declaration I receive the Warnings above. I thought that $post and $product would give me access to the term data.
So what am I missing here?
thanks