Skip to content

Commit

Permalink
Fix: get_header_logo_id() return type fatal error (#835)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmigf authored Jul 16, 2024
1 parent eec59d7 commit e8ff925
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions includes/documents/abstract-wcpdf-order-document.php
Original file line number Diff line number Diff line change
Expand Up @@ -820,14 +820,10 @@ public function has_header_logo() {
* @return int
*/
public function get_header_logo_id(): int {
$header_logo_id = 0;
$header_logo_id = ! empty( $this->settings['header_logo'] ) ? $this->get_settings_text( 'header_logo', 0, false ) : 0;
$header_logo_id = apply_filters( 'wpo_wcpdf_header_logo_id', $header_logo_id, $this );

if ( ! empty( $this->settings['header_logo'] ) ) {
$attachment_id = $this->get_settings_text( 'header_logo', $header_logo_id, false );
$header_logo_id = is_numeric( $attachment_id ) ? absint( $attachment_id ) : 0;
}

return apply_filters( 'wpo_wcpdf_header_logo_id', $header_logo_id, $this );
return $header_logo_id && is_numeric( $header_logo_id ) ? absint( $header_logo_id ) : 0;
}

/**
Expand Down

0 comments on commit e8ff925

Please sign in to comment.