Add a custom field to the WP Job Manager Job Listings Admin List Table (unsortable)

functions.php

<?php

//ONLY ADD COLUMN AND CONTENT TO CUSTOM JOB LISTINGS POSTS
add_filter('manage_job_listing_posts_columns', 'xyz123_my_custom_job_listing_columns');
add_action('manage_job_listing_posts_custom_column', 'xyz123_my_custom_job_listing_column_value', 10, 2);

// ADD COLUMN TO LIST TABLE
function xyz123_my_custom_job_listing_columns($defaults) {
	$defaults['job_metakey'] = 'LabelHere';
	return $defaults;
}

// OUTPUT VALUE IN COLUMN LIST TABLE
function xyz123_my_custom_job_listing_column_value($column_name, $post_ID) {
	// Check if $column_name matches the meta key you want to output
	if ($column_name == 'job_metakey') {
		the_job_field( 'job_metakey' );
	}
}
No comments yet.

Leave a Reply