View Categories

Troubleshooting and Developer Filters

Customizing Shortcode Output #

For advanced customization of shortcode output, the plugin provides the alg_wc_pdf_invoicing_return_prop filter. This allows developers to intercept and modify the value returned by any shortcode.

Filter Example #

The following example demonstrates how to use a custom attribute (my_custom_filter="1") on a shortcode to trigger a custom date format based on the current language:

add_filter(
    'alg_wc_pdf_invoicing_return_prop',
    function ( $value, $atts, $shortcodes_obj ) {

        // Run only when the custom attribute is present
        if ( empty( $atts['my_custom_filter'] ) ) {
            return $value;
        }

        $language  = strtoupper(
            $shortcodes_obj->get_current_language_for_translate()
        );
        $timestamp = strtotime( $value );

        switch ( $language ) {
            case 'DE':
                // Custom German date format
                return date( 'F j, Y, g:i a', $timestamp );

            default:
                // Default format
                return date( 'Y-m-d H:i:s', $timestamp );
        }
    },
    10,
    3
);
  

If you wish to remove the default border lines from the header or footer, navigate to the respective document settings and set the Header line color or Footer line color option to: #ffffff

This documentation serves as a clear and complete guide, covering everything from initial setup to advanced customization.