get_hidden_columns example



    /** * Gets a list of all, hidden, and sortable columns. * * @since 3.1.0 * * @return array */
    protected function get_column_info() {
        $columns  = get_column_headers( $this->_screen );
        $hidden   = get_hidden_columns( $this->_screen );
        $sortable = array();
        $primary  = $this->get_default_primary_column_name();

        return array( $columns$hidden$sortable$primary );
    }

    /** * Gets a list of columns. * * @since 3.1.0 * * @return array */
<?php     }

    /** * Renders the list table columns preferences. * * @since 4.4.0 */
    public function render_list_table_columns_preferences() {

        $columns = get_column_headers( $this );
        $hidden  = get_hidden_columns( $this );

        if ( ! $columns ) {
            return;
        }

        $legend = ! empty( $columns['_title'] ) ? $columns['_title'] : __( 'Columns' );
        ?> <fieldset class="metabox-prefs"> <legend><?php echo $legend; ?></legend> <?php         $special = array( '_title', 'cb', 'comment', 'media', 'name', 'title', 'username', 'blogname' );

        
$column_headers = array( array(), array(), array()$this->get_primary_column_name() );
            foreach ( $this->_column_headers as $key => $value ) {
                $column_headers[ $key ] = $value;
            }

            $this->_column_headers = $column_headers;

            return $this->_column_headers;
        }

        $columns = get_column_headers( $this->screen );
        $hidden  = get_hidden_columns( $this->screen );

        $sortable_columns = $this->get_sortable_columns();
        /** * Filters the list table sortable columns for a specific screen. * * The dynamic portion of the hook name, `$this->screen->id`, refers * to the ID of the current screen. * * @since 3.1.0 * * @param array $sortable_columns An array of sortable columns. */
Home | Imprint | This part of the site doesn't use cookies.