WC_Admin_List_Table_Coupons::prepare_row_data()protectedWC 1.0

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

Метод класса: WC_Admin_List_Table_Coupons{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->prepare_row_data( $post_id );
$post_id(int) (обязательный)
Post ID being shown.

Код WC_Admin_List_Table_Coupons::prepare_row_data() WC 8.7.0

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;
	}
}