apply_filters( 'lp__price_html_args', $args, $price, $sale_price )
This code filters and customizes the price HTML arguments.
Plugin
Namespace
Launchpad
Parameters
array
$args
Price HTML arguments
float
$price
Regular price
float
$sale_price
Sale price
Return
string
Filtered price HTML arguments
Example
Here’s how you can customize the price HTML arguments using the lp__price_html_args filter:
// Add the filter hook for customizing price HTML arguments
add_filter( 'lp__price_html_args', function( $args ){
// Add custom CSS class to the price HTML
$args['class'] = 'custom-price';
// Return the modified price HTML arguments
return $args;
} );
After applying this customization, the HTML representation of prices will include the custom-price CSS class, allowing you to style prices with custom CSS rules.
Feel free to adjust the contents and settings of the price HTML arguments inside the filter callback function according to your specific needs. This flexibility allows you to customize how prices are displayed on your website to align with your design preferences.