• Resolved sasori390

    (@sasori390)


    When “Output to HTML” is enabled, I want to change the label “Download invoice (PDF)” to something like “Print Invoice”. Is there a way to do so without hacking the original source code?

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Hi! The “Output to HTML” function is meant for debugging purposes only (I wouldn’t recommend this for frontend purposes either), and as such doesn’t really facilitate this, but you could use the wpo_wcpdf_myaccount_button_text filter to change the text shown in My account.

    
    add_filter( 'wpo_wcpdf_myaccount_button_text', 'wpo_wcpdf_myaccount_button_text', 10, 2 )
    function wpo_wcpdf_myaccount_button_text( $button_text, $invoice ) {
    	$status_settings = get_option('wpo_wcpdf_settings_debug');
    	if ( !empty($status_settings) && isset($status_settings['html_output']) ) {
    		$button_text = 'Print Invoice';
    	}
    	return $button_text;
    }
    

    If you haven’t worked with code snippets (actions/filters) or functions.php before, read this guide: How to use filters

    Hope that helps!
    Ewout

Viewing 1 replies (of 1 total)
  • The topic ‘Change label text’ is closed to new replies.