WC_Admin_List_Table_Products::prepare_row_data
Pre-fetch any data for the row each column has access to it. the_product global is there for bw compat.
Метод класса: WC_Admin_List_Table_Products{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->prepare_row_data( $post_id );
- $post_id(int) (обязательный)
- Post ID being shown.
Код WC_Admin_List_Table_Products::prepare_row_data() WC Admin List Table Products::prepare row data WC 10.6.2
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;
}
}