Skip to content

Commit

Permalink
Fix: return default WP meta behavior for GiveWP types (#7062)
Browse files Browse the repository at this point in the history
Co-authored-by: Jason Adams <[email protected]>
  • Loading branch information
ravinderk and JasonTheAdams authored Nov 2, 2023
1 parent 224bf77 commit 0171195
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions includes/database/class-give-db-meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ function __construct() {
/**
* Retrieve payment meta field for a payment.
*
* @access public
* @unreleased Return empty array, when request raw metadata if $single is set to false and metadata does not exist.
* @since 2.0
*
* @param int $id Pst Type ID.
Expand All @@ -150,7 +150,7 @@ public function get_meta( $id = 0, $meta_key = '', $single = false ) {

if ( $this->raw_result ) {
if ( ! ( $value = get_metadata( $this->meta_type, $id, $meta_key, false ) ) ) {
$value = '';
$value = $single ? '' : array();
}

// Reset flag.
Expand Down

0 comments on commit 0171195

Please sign in to comment.