Skip to content

Instantly share code, notes, and snippets.

@chrismademe
Created June 13, 2019 08:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrismademe/2545e8d7878441ea382b92f7da5d95d7 to your computer and use it in GitHub Desktop.
Save chrismademe/2545e8d7878441ea382b92f7da5d95d7 to your computer and use it in GitHub Desktop.
WordPress Post List (Admin)
<?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