Created
June 13, 2019 08:06
-
-
Save chrismademe/2545e8d7878441ea382b92f7da5d95d7 to your computer and use it in GitHub Desktop.
WordPress Post List (Admin)
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 | |
/* | |
* Manage Vacancies Columns | |
*/ | |
add_filter( 'manage_vacancies_posts_columns', function ( $columns ) { | |
// Checkbox column | |
$cb = $columns['cb']; | |
// Change Title row name | |
return array( | |
'cb' => $cb, | |
'groups' => 'Groups' | |
); | |
} ); | |
/** | |
* Get data for custom vacancies columns | |
*/ | |
add_action( 'manage_vacancies_posts_custom_column', function( $column, $post_id ) { | |
// Get the fields | |
$fields = get_fields($post_id); | |
if ( $column === 'groups' ) { | |
// Echo things here | |
} | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment