Inventory_Presser_Customize_Dashboard::populate_columns_we_added_to_vehicles_table( string $column_name, int $post_id )

populate_columns_we_added_to_vehicles_table


Description Description

Populates the custom columns we added to the posts table in the dashboard.


Top ↑

Parameters Parameters

$column_name

(string) (Required)

$post_id

(int) (Required)


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/class-customize-admin-dashboard.php

	function populate_columns_we_added_to_vehicles_table( $column_name, $post_id )
	{
		$custom_fields = get_post_custom( $post_id );
		$val = ( isset( $custom_fields[$column_name] ) ? $custom_fields[$column_name][0] : '' );
		switch( true )
		{
			case $column_name == apply_filters( 'invp_prefix_meta_key', 'thumbnail' ):
				echo edit_post_link( get_the_post_thumbnail( $post_id, 'thumbnail' ) );
				break;

			case $column_name == apply_filters( 'invp_prefix_meta_key', 'odometer' ):
				echo invp_get_the_odometer('', $post_id );
				break;

			case $column_name == apply_filters( 'invp_prefix_meta_key', 'photo_count' ):
				echo count( get_children( array( 'post_parent' => $post_id ) ) );
				break;

			case $column_name == apply_filters( 'invp_prefix_meta_key', 'price' ):
				echo invp_get_the_price( '-', $post_id );
				break;

			default:
				echo $val;
		}
	}