columns = $columns; $this->data = $data; $this->args = $args; } /** * Display the table. * * @since 1.5.0 * * @return void */ public function render() { if ( empty( $this->columns ) ) { return; } charitable_template( 'tables/table.php', array( 'helper' => $this ) ); } /** * Render a table row. * * @since 1.5.0 * * @param array $rowdata The data to be displayed on this row. * @return void */ public function render_row( $row_data ) { charitable_template( 'tables/row.php', array( 'data' => $row_data, 'columns' => $this->columns ) ); } /** * Return a string containing the table attributes. * * @since 1.5.0 * * @return string */ public function table_attributes() { $attrs = ''; foreach ( $this->table_attributes as $attr ) { if ( ! array_key_exists( $attr, $this->args ) ) { continue; } $attrs .= sprintf( ' %s="%s"', $attr, esc_attr( $this->args[ $attr ] ) ); } return ltrim( $attrs ); } } endif;