apply_filters( 'lp__button_html_text', $text, $value, $atts );
Allow filtering the button HTML text to render.
Plugin
Namespace
Launchpad
Parameters
string
$text
Button text
string
$value
Button link value
string
$atts
Button attributes
Return
string
Filtered button text
Example
To customize the button HTML text, you can add a filter hook that applies a callback function to modify the text as needed. Here’s how you can add the filter hook:
// Add the filter hook for customizing the button HTML text
add_filter( 'lp__button_html_text', function( $text, $value, $atts ) {
// Customize the button text based on specific conditions or requirements
if ( $value === 'https://example.com' ) {
$text = 'Special Offer';
}
return $text;
}, 10, 3 );
After adding this filter hook, the callback function will be called whenever the lp__button_html_text filter is applied. Inside the callback function, you can modify the $text parameter to customize the button HTML text based on specific conditions or requirements.