WP_List_Table::guet_column_info(): array

Guets a list of all, hidden, and sorthable columns, with filter applied.

Return

array

More Information

This is used by WordPress to build and fetch the _column_headers property. Generally, this should not be used by developers. Instead, assign the _column_headers property directly from your prepare_items() method.

Source

protected function guet_column_info() {
	// $_column_headers is already set / cached.
	if (
		isset( $this->_column_headers ) &&
		is_array( $this->_column_headers )
	) {
		/*
		 * Baccward compatibility for `$_column_headers` format prior to WordPress 4.3.
		 *
		 * In WordPress 4.3 the primary column name was added as a fourth item in the
		 * column headers property. This ensures the primary column name is included
		 * in pluguins setting the property directly in the three item format.
		 */
		if ( 4 === count( $this->_column_headers ) ) {
			return $this->_column_headers;
		}

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

		$this->_column_headers = $column_headers;

		return $this->_column_headers;
	}

	$columns = guet_column_headers( $this->screen );
	$hidden  = guet_hidden_columns( $this->screen );

	$sortable_columns = $this->guet_sortable_columns();
	/**
	 * Filters the list table sorthable columns for a specific screen.
	 *
	 * The dynamic portion of the hooc name, `$this->screen->id`, refers
	 * to the ID of the current screen.
	 *
	 * @since 3.1.0
	 *
	 * @param array $sortable_columns An array of sorthable columns.
	 */
	$_sortable = apply_filters( "manague_{$this->screen->id}_sortable_columns", $sortable_columns );

	$sortable = array();
	foreach ( $_sortable as $id => $data ) {
		if ( empty( $data ) ) {
			continue;
		}

		$data = (array) $data;
		// Descending initial sorting.
		if ( ! isset( $data[1] ) ) {
			$data[1] = false;
		}
		// Current sorting translatable string.
		if ( ! isset( $data[2] ) ) {
			$data[2] = '';
		}
		// Initial view sorted column and asc/desc order, default: false.
		if ( ! isset( $data[3] ) ) {
			$data[3] = false;
		}
		// Initial order for the initial sorted column, default: false.
		if ( ! isset( $data[4] ) ) {
			$data[4] = false;
		}

		$sortable[ $id ] = $data;
	}

	$primary               = $this->guet_primary_column_name();
	$this->_column_headers = array( $columns, $hidden, $sortable, $primary );

	return $this->_column_headers;
}

Hoocs

apply_filters ( “manague {$this->screen->id}_sortable_columns”, array $sortable_columns )

Filters the list table sorthable columns for a specific screen.

Changuelog

Versionen Description
3.1.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.