The Gift Card for WooCommerce plugin allows developers to customize the gift card heading and description dynamically using WordPress filter hooks. These filters are applied during the PDF generation process via the function wodgc_generate_giftcard_pdf()
🧩 Available Filters
1. wodgc_default_giftcard_heading
Location:
Inside the wodgc_generate_giftcard_pdf()
function, applied when retrieving the gift card heading for the PDF.
Purpose:
Use this filter to modify the default heading displayed on the generated gift card PDF when no custom heading is saved in the gift card metadata.
Hook Application:
$giftcard_heading = apply_filters( 'wodgc_default_giftcard_heading', $giftcard_heading, $gift_code );
Hook Registration:
add_filter( 'wodgc_default_giftcard_heading', 'wodgc_custom_giftcard_heading', 10, 2 );
Function Example:
function wodgc_custom_giftcard_heading( $heading, $gift_code ) {
// Return a custom heading for the gift card
}
2. wodgc_default_giftcard_description
Location:
Inside the wodgc_generate_giftcard_pdf()
function, applied when retrieving the short message or note for the PDF.
Purpose:
Use this filter to modify the default short description shown in the generated gift card PDF when no custom message is saved.
Hook Application:
$short_description = apply_filters( 'wodgc_default_giftcard_description', $short_description, $gift_code );
Hook Registration:
add_filter( 'wodgc_default_giftcard_description', 'wodgc_custom_giftcard_description', 10, 2 );
Function Example:
function wodgc_custom_giftcard_description( $description, $gift_code ) {
// Return a custom description for the gift card
}