WC_Admin_List_Table_Products::prepare_row_data()protectedWC 1.0

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

{} It's a method of the class: WC_Admin_List_Table_Products{}

No Hooks.

Return

null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->prepare_row_data( $post_id );
$post_id(int) (required)
Post ID being shown.

Code of WC_Admin_List_Table_Products::prepare_row_data() WC 6.7.0

protected function prepare_row_data( $post_id ) {
	global $the_product;

	if ( empty( $this->object ) || $this->object->get_id() !== $post_id ) {
		$the_product  = wc_get_product( $post_id );
		$this->object = $the_product;
	}
}