WC_Admin_List_Table_Coupons::prepare_row_data() – Pre-fetch any data for the row each column has access to it. the_coupon global is there for bw compat.

You appear to be a bot. Output may be restricted

Description

Pre-fetch any data for the row each column has access to it. the_coupon global is there for bw compat.

Usage

WC_Admin_List_Table_Coupons::prepare_row_data( $post_id );

Parameters

$post_id
( int ) required – Post ID being shown.

Returns

void

Source

File name: woocommerce/includes/admin/list-tables/class-wc-admin-list-table-coupons.php


Lines:

1 to 9 of 9
  protected function prepare_row_data( $post_id ) {
    global $the_coupon;

    if ( empty( $this->object ) || $this->object->get_id() !== $post_id ) {
      $this->object = new WC_Coupon( $post_id );
      $the_coupon   = $this->object;
    }
  }
 

 View on GitHub View on Trac