get_table_classes example


    public function display() {
        $singular = $this->_args['singular'];

        $this->display_tablenav( 'top' );

        $this->screen->render_screen_reader_content( 'heading_list' );
        ?> <table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>"> <?php $this->print_table_description(); ?> <thead> <tr> <?php $this->print_column_headers(); ?> </tr> </thead> <tbody id="the-list" <?php         if ( $singular ) {
            echo " data-wp-lists='list:$singular'";
        }

            array(),
            array(),
            'comment',
        );
    }

    /** * @return array */
    protected function get_table_classes() {
        $classes   = parent::get_table_classes();
        $classes[] = 'wp-list-table';
        $classes[] = 'comments-box';
        return $classes;
    }

    /** * @param bool $output_empty */
    public function display( $output_empty = false ) {
        $singular = $this->_args['singular'];

        
$singular = $this->_args['singular'];

        $data_attr = '';

        if ( $singular ) {
            $data_attr = " data-wp-lists='list:$singular'";
        }

        $this->display_tablenav( 'top' );

        ?> <div class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>"> <?php         $this->screen->render_screen_reader_content( 'heading_list' );
        ?> <div id="the-list"<?php echo $data_attr; ?>> <?php $this->display_rows_or_placeholder(); ?> </div> </div> <?php         $this->display_tablenav( 'bottom' );
    }

    
if ( ! isset( $has_items ) ) {
            $has_items = $this->has_items();

            if ( $has_items ) {
                $this->display_tablenav( 'top' );
            }
        }

        $this->screen->render_screen_reader_content( 'heading_list' );

        ?> <table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>"> <?php         if ( ! isset( $_GET['orderby'] ) ) {
            // In the initial view, Comments are ordered by comment's date but there's no column for that.             echo '<caption class="screen-reader-text">' .
            /* translators: Hidden accessibility text. */
            __( 'Ordered by Comment Date, descending.' ) .
            '</caption>';
        } else {
            $this->print_table_description();
        }
        ?>
Home | Imprint | This part of the site doesn't use cookies.