data['disable_labels'] = false; /** * Enable/disable product labels inside table * @since 1.44 * @param bool Show or not labels for products tables */ $this->data['disable_labels'] = apply_filters( 'awl_hide_for_barn2_tables', $this->data['disable_labels'] ); add_filter('wc_product_table_cell_data_image', array( $this, 'wc_product_table_cell_data_image' ) ); add_filter('wc_product_table_data_image', array( $this, 'wc_product_table_cell_data_image' ) ); add_filter('wc_product_table_cell_data_name', array( $this, 'wc_product_table_cell_data_name' ) ); add_filter('wc_product_table_data_name', array( $this, 'wc_product_table_cell_data_name' ) ); } /* * Show labels for table image column */ public function wc_product_table_cell_data_image( $data ) { if ( ! ( isset( $this->data['disable_labels'] ) && $this->data['disable_labels'] ) ) { $data = '
' . AWL_Label_Display::instance()->show_label( 'on_image' ) . $data . '
'; } return $data; } /* * Show labels for table name column */ public function wc_product_table_cell_data_name( $data ) { if ( ! ( isset( $this->data['disable_labels'] ) && $this->data['disable_labels'] ) ) { $data = AWL_Label_Display::instance()->show_label( 'before_title' ) . $data; } return $data; } } endif; AWL_Barn_Tables::instance();