public function renderAdminColumn($column_name, $item_id)
    {
        $columns = $this->getAdminColumns();
        if (!in_array($column_name, $columns)) {
            return;
        }

        $field = $this->getField($column_name);
        if (is_array($field)) {
            $class = get_called_class();
            $entry = new $class;
            $entry->load($item_id);
            $out = $entry->get($column_name);
            if (isset($field['type'])) {
                switch ($field['type']) {
                    case 'checkbox':
                        $checkbox_display = $entry->getCheckboxDisplay($column_name);
                        $out = ($entry->get($column_name))
                            ? reset($checkbox_display)
                            : end($checkbox_display);
                        break;
                    case 'image':
                        $out = Html::image($entry->get($column_name), $entry->get($column_name), array('class'=>'thumbnail'));
                        break;
                    case 'select':
                        $out = array_key_exists($entry->get($column_name), $field['options'])
                            ? $field['options'][$entry->get($column_name)]
                            : null;
                        break;
                }
            }

            // Hide the title field if necessary.
            // But since the title field is the link to the edit page
            // we are instead going to link the first custom field column.
            if (method_exists($this, 'getHideTitleFromAdminColumns')
                && $this->getHideTitleFromAdminColumns()
                && method_exists($this, 'getEditPermalink')
                && array_search($column_name, array_values($columns)) === 0
            ) {
                $out = sprintf('<a href="%s">%s</a>', $this->getEditPermalink(), $out);
            }

            echo $out;
            return;
        }

        if (Arr::iterable($this->getTaxonomies())) {
            $taxonomy_key = $this->getTaxonomyKey($column_name);
            if ($taxonomy_key) {
                echo get_the_term_list($item_id, $taxonomy_key, null, ', ');
                return;
            }
        }
    }
public function renderAdminColumn($column_name, $item_id)
    {
        $columns = $this->getAdminColumns();
        if (!in_array($column_name, $columns)) {
            return;
        }

        $field = $this->getField($column_name);
        if (is_array($field)) {
            $class = get_called_class();
            $entry = new $class;
            $entry->load($item_id);
            $out = $entry->get($column_name);
            if (isset($field['type'])) {
                switch ($field['type']) {
                    case 'checkbox':
                        $checkbox_display = $entry->getCheckboxDisplay($column_name);
                        $out = ($entry->get($column_name))
                            ? reset($checkbox_display)
                            : end($checkbox_display);
                        break;
                    case 'image':
                        $out = Html::image($entry->get($column_name), $entry->get($column_name), array('class'=>'thumbnail'));
                        break;
                    case 'select':
                        $out = array_key_exists($entry->get($column_name), $field['options'])
                            ? $field['options'][$entry->get($column_name)]
                            : null;
                        break;
                }
            }

            // Hide the title field if necessary.
            // But since the title field is the link to the edit page
            // we are instead going to link the first custom field column.
            if (method_exists($this, 'getHideTitleFromAdminColumns')
                && $this->getHideTitleFromAdminColumns()
                && method_exists($this, 'getEditPermalink')
                && array_search($column_name, array_values($columns)) === 0
            ) {
                $out = sprintf('<a href="%s">%s</a>', $this->getEditPermalink(), $out);
            }

            echo $out;
            return;
        }

        if (Arr::iterable($this->getTaxonomies())) {
            $taxonomy_key = $this->getTaxonomyKey($column_name);
            if ($taxonomy_key) {
                echo get_the_term_list($item_id, $taxonomy_key, null, ', ');
                return;
            }
        }
    }
public function renderAdminColumn ( $ column_name , $ item_id ) { $ columns = $ this -> getAdminColumns ( ) ; if ( ! in_array ( $ column_name , $ columns ) ) { return ; } $ field = $ this -> getField ( $ column_name ) ; if ( is_array ( $ field ) ) { $ class = get_called_class ( ) ; $ entry = new $ class ; $ entry -> load ( $ item_id ) ; $ out = $ entry -> get ( $ column_name ) ; if ( isset ( $ field [ 'type' ] ) ) { switch ( $ field [ 'type' ] ) { case 'checkbox' : $ checkbox_display = $ entry -> getCheckboxDisplay ( $ column_name ) ; $ out = ( $ entry -> get ( $ column_name ) ) ? reset ( $ checkbox_display ) : end ( $ checkbox_display ) ; break ; case 'image' : $ out = Html :: image ( $ entry -> get ( $ column_name ) , $ entry -> get ( $ column_name ) , array ( 'class' => 'thumbnail' ) ) ; break ; case 'select' : $ out = array_key_exists ( $ entry -> get ( $ column_name ) , $ field [ 'options' ] ) ? $ field [ 'options' ] [ $ entry -> get ( $ column_name ) ] : null ; break ; } } // Hide the title field if necessary. // But since the title field is the link to the edit page // we are instead going to link the first custom field column. if ( method_exists ( $ this , 'getHideTitleFromAdminColumns' ) && $ this -> getHideTitleFromAdminColumns ( ) && method_exists ( $ this , 'getEditPermalink' ) && array_search ( $ column_name , array_values ( $ columns ) ) === 0 ) { $ out = sprintf ( '<a href="%s">%s</a>' , $ this -> getEditPermalink ( ) , $ out ) ; } echo $ out ; return ; } if ( Arr :: iterable ( $ this -> getTaxonomies ( ) ) ) { $ taxonomy_key = $ this -> getTaxonomyKey ( $ column_name ) ; if ( $ taxonomy_key ) { echo get_the_term_list ( $ item_id , $ taxonomy_key , null , ', ' ) ; return ; } } }
Render an admin column
@param string $column_name
@param integer $item_id
Render an admin column