WP_MS_Themes_List_Table::single_row_columns() – Handles the output for a single table row.

You appear to be a bot. Output may be restricted

Description

Handles the output for a single table row.

Usage

WP_MS_Themes_List_Table::single_row_columns( $item );

Parameters

$item
( WP_Theme ) required – The current WP_Theme object.

Returns

void

Source

File name: wordpress/wp-admin/includes/class-wp-ms-themes-list-table.php
Lines:

1 to 69 of 69
  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">';

          $this->WP_MS_Themes_List_Table::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' );

            /* Add a label for the active template */
            if ( $item->get_template() === $template ) {
              $active_theme_label = ' &mdash; ' . __( 'Active Theme' );
            }

            /* In case this is a child theme, label it properly */
            if ( $stylesheet !== $template && $item->get_stylesheet() === $stylesheet ) {
              $active_theme_label = ' &mdash; ' . __( 'Active Child Theme' );
            }
          }

          echo "<td class='theme-title column-primary{$extra_classes}'><strong>" . $item->display( 'Name' ) . $active_theme_label . '</strong>';

          $this->WP_MS_Themes_List_Table::column_name( $item );

          echo '</td>';
          break;

        case 'description':
          echo "<td class='column-description desc{$extra_classes}'>";

          $this->WP_MS_Themes_List_Table::column_description( $item );

          echo '</td>';
          break;

        case 'auto-updates':
          echo "<td class='column-auto-updates{$extra_classes}'>";

          $this->column_autoupdates( $item );

          echo '</td>';
          break;
        default:
          echo "<td class='$column_name column-$column_name{$extra_classes}'>";

          $this->WP_MS_Themes_List_Table::column_default( $item, $column_name );

          echo '</td>';
          break;
      }
    }
  }
 

 View on GitHub View on Trac