Making WordPress.org

Changeset 7914


Ignore:
Timestamp:
11/29/2018 03:19:26 AM (6 years ago)
Author:
iandunn
Message:

CampTix Badge Generator: Return empty string if post is not found.

Otherwise a PHP notice will be thrown if the corresponding post has been deleted or is otherwise unavailable.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/camptix-badge-generator/includes/common.php

    r7913 r7914  
    162162            if ( $attendee->tix_coupon_id ) {
    163163                $coupon = get_post( $attendee->tix_coupon_id );
    164                 $value  = $coupon->post_name;
     164                $value  = $coupon->post_name ?? '';
    165165            }
    166166            break;
     
    181181        case 'ticket':
    182182            $ticket = get_post( $attendee->tix_ticket_id );
    183             $value  = $ticket->post_name;
     183            $value  = $ticket->post_name ?? '';
    184184            break;
    185185    }
Note: See TracChangeset for help on using the changeset viewer.