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

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


Parameters Parameters

$column_name

(string) (Required)

$post_id

(int) (Required)


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/admin/class-admin-posts-list.php

	public 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 ( $column_name ) {
			case apply_filters( 'invp_prefix_meta_key', 'thumbnail' ):
				/* phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped */
				echo edit_post_link( get_the_post_thumbnail( $post_id, 'thumbnail' ) );
				break;

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

			case apply_filters( 'invp_prefix_meta_key', 'photo_count' ):
				echo esc_html( invp_get_the_photo_count( $post_id ) );
				break;

			case apply_filters( 'invp_prefix_meta_key', 'price' ):
				/**
				 * Template tag invp_get_the_price() sometimes returns HTML and
				 * escapes its own entities.
				 */
				/* phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped */
				echo invp_get_the_price( '-', $post_id );
				break;

			default:
				echo esc_html( $val );
		}
	}