get_column_headers example

return $this->get_primary_column_name();
    }

    /** * Gets the name of the primary column. * * @since 4.3.0 * * @return string The name of the primary column. */
    protected function get_primary_column_name() {
        $columns = get_column_headers( $this->screen );
        $default = $this->get_default_primary_column_name();

        /* * If the primary column doesn't exist, * fall back to the first non-checkbox column. */
        if ( ! isset( $columns[ $default ] ) ) {
            $default = self::get_default_primary_column_name();
        }

        /** * Filters the name of the primary column for the current list table. * * @since 4.3.0 * * @param string $default Column name default for the specific list table, e.g. 'name'. * @param string $context Screen ID for specific list table, e.g. 'plugins'. */

    public function show_screen_options() {
        global $wp_meta_boxes;

        if ( is_bool( $this->_show_screen_options ) ) {
            return $this->_show_screen_options;
        }

        $columns = get_column_headers( $this );

        $show_screen = ! empty( $wp_meta_boxes[ $this->id ] ) || $columns || $this->get_option( 'per_page' );

        $this->_screen_settings = '';

        if ( 'post' === $this->base ) {
            $expand                 = '<fieldset class="editor-expand hidden"><legend>' . __( 'Additional settings' ) . '</legend><label for="editor-expand-toggle">';
            $expand                .= '<input type="checkbox" id="editor-expand-toggle"' . checked( get_user_setting( 'editor_expand', 'on' ), 'on', false ) . ' />';
            $expand                .= __( 'Enable full-height editor and distraction-free functionality.' ) . '</label></fieldset>';
            $this->_screen_settings = $expand;
        }

        

    }

    /** * 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 */
Home | Imprint | This part of the site doesn't use cookies.