column_cb example

/* * Comments column uses HTML in the display name with screen reader text. * Strip tags to get closer to a user-friendly string. */
            $data = 'data-colname="' . esc_attr( wp_strip_all_tags( $column_display_name ) ) . '"';

            $attributes = "class='$classes' $data";

            if ( 'cb' === $column_name ) {
                echo '<th scope="row" class="check-column">';
                echo $this->column_cb( $item );
                echo '</th>';
            } elseif ( method_exists( $this, '_column_' . $column_name ) ) {
                echo call_user_func(
                    array( $this, '_column_' . $column_name ),
                    $item,
                    $classes,
                    $data,
                    $primary
                );
            } elseif ( method_exists( $this, 'column_' . $column_name ) ) {
                echo "<td $attributes>";
                
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">';

                    $this->column_cb( $item );

                    echo '</th>';
                    break;

                case 'name':
                    $active_theme_label = '';

                    /* The presence of the site_id property means that this is a subsite view and a label for the active theme needs to be added */
                    if ( ! empty( $this->site_id ) ) {
                        $stylesheet = get_blog_option( $this->site_id, 'stylesheet' );
                        $template   = get_blog_option( $this->site_id, 'template' );

                        
Home | Imprint | This part of the site doesn't use cookies.