get_column_info example

<?php             $core_columns = array(
                'cb'          => true,
                'description' => true,
                'name'        => true,
                'slug'        => true,
                'posts'       => true,
            );

            list( $columns ) = $this->get_column_info();

            foreach ( $columns as $column_name => $column_display_name ) {
                if ( isset( $core_columns[ $column_name ] ) ) {
                    continue;
                }

                /** This action is documented in wp-admin/includes/class-wp-posts-list-table.php */
                do_action( 'quick_edit_custom_box', $column_name, 'edit-tags', $this->screen->taxonomy );
            }
            ?> <div class="inline-edit-save submit"> <button type="button" class="save button button-primary">
return $this->_column_headers;
    }

    /** * Returns the number of visible columns. * * @since 3.1.0 * * @return int */
    public function get_column_count() {
        list ( $columns$hidden ) = $this->get_column_info();
        $hidden                    = array_intersect( array_keys( $columns )array_filter( $hidden ) );
        return count( $columns ) - count( $hidden );
    }

    /** * Prints column headers, accounting for hidden and sortable columns. * * @since 3.1.0 * * @param bool $with_id Whether to set the ID attribute or not */
    
<?php endforeach; ?> <?php endif; ?> </select> </label> <?php endif; ?> </div> </fieldset> <?php             list( $columns ) = $this->get_column_info();

            foreach ( $columns as $column_name => $column_display_name ) {
                if ( isset( $core_columns[ $column_name ] ) ) {
                    continue;
                }

                if ( $bulk ) {

                    /** * Fires once for each column in Bulk Edit mode. * * @since 2.7.0 * * @param string $column_name Name of the column to edit. * @param string $post_type The post type slug. */
 else {
            $edit = "<strong>{$user_object->user_login}{$super_admin}</strong>";
        }

        $avatar = get_avatar( $user_object->ID, 32 );

        // Comma-separated list of user roles.         $roles_list = implode( ', ', $user_roles );

        $row = "<tr id='user-$user_object->ID'>";

        list( $columns$hidden$sortable$primary ) = $this->get_column_info();

        foreach ( $columns as $column_name => $column_display_name ) {
            $classes = "$column_name column-$column_name";
            if ( $primary === $column_name ) {
                $classes .= ' has-row-actions column-primary';
            }
            if ( 'posts' === $column_name ) {
                $classes .= ' num'; // Special case for that column.             }

            if ( in_array( $column_name$hidden, true ) ) {
                
        );
    }

    /** * Handles the output for a single table row. * * @since 4.3.0 * * @param WP_Theme $item The current WP_Theme object. */
    public function single_row_columns( $item ) {
        list( $columns$hidden$sortable$primary ) = $this->get_column_info();

        foreach ( $columns as $column_name => $column_display_name ) {
            $extra_classes = '';
            if ( in_array( $column_name$hidden, true ) ) {
                $extra_classes .= ' hidden';
            }

            switch ( $column_name ) {
                case 'cb':
                    echo '<th scope="row" class="check-column">';

                    

    protected function get_default_primary_column_name() {
        return 'name';
    }

    /** * Prints the JavaScript template for the new row item. * * @since 5.6.0 */
    public function print_js_template_row() {
        list( $columns$hidden, , $primary ) = $this->get_column_info();

        echo '<tr data-uuid="{{ data.uuid }}">';

        foreach ( $columns as $column_name => $display_name ) {
            $is_primary = $primary === $column_name;
            $classes    = "{$column_name} column-{$column_name}";

            if ( $is_primary ) {
                $classes .= ' has-row-actions column-primary';
            }

            
if ( is_uninstallable_plugin( $plugin_file ) ) {
            $class .= ' is-uninstallable';
        }

        printf(
            '<tr class="%s" data-slug="%s" data-plugin="%s">',
            esc_attr( $class ),
            esc_attr( $plugin_slug ),
            esc_attr( $plugin_file )
        );

        list( $columns$hidden$sortable$primary ) = $this->get_column_info();

        $auto_updates = (array) get_site_option( 'auto_update_plugins', array() );

        foreach ( $columns as $column_name => $column_display_name ) {
            $extra_classes = '';
            if ( in_array( $column_name$hidden, true ) ) {
                $extra_classes = ' hidden';
            }

            switch ( $column_name ) {
                case 'cb':
                    
Home | Imprint | This part of the site doesn't use cookies.