Last active
March 28, 2019 00:14
-
-
Save renemorozowich/fc03d335ddc39251456c44ff536c81fa to your computer and use it in GitHub Desktop.
Changing Columns on the Job Dashboard of WP Job Manager
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Customize columns in WP Job Manager [job_dashboard]. | |
function custom_job_manager_job_dashboard_columns( $columns ) { | |
// Remove all columns. | |
unset( $columns['job_title'] ); | |
unset( $columns['filled'] ); | |
unset( $columns['date'] ); | |
unset( $columns['expires'] ); | |
// Add columns with proper headings in the correct order. | |
$columns['job_id'] = 'ID'; | |
$columns['job_title'] = 'Job'; | |
$columns['date'] = 'Date'; | |
$columns['job_location'] = 'Location'; | |
$columns['filled'] = 'Filled'; | |
$columns['expires'] = 'Expires'; | |
// Return. | |
return $columns; | |
} | |
// Populate ID column. | |
add_action( 'job_manager_job_dashboard_column_job_id', function( $post ) { | |
echo $post->ID; | |
} ); | |
// Populate Location column. | |
add_action( 'job_manager_job_dashboard_column_job_location', function( $post ) { | |
echo get_post_meta( $post->ID, '_job_location', true ); | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
the question might be "stupid" but I'm really looking for a solution to my problem.
Where should I put (path or folder) this functions.php file in order to get the desired functionality?
Thank you in advance!
Best,
Nas