Skip to content

Instantly share code, notes, and snippets.

@Basilakis
Created September 29, 2019 16:45
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 Basilakis/9456d8e8b53cd47a3d28fb53eda0ebb6 to your computer and use it in GitHub Desktop.
Save Basilakis/9456d8e8b53cd47a3d28fb53eda0ebb6 to your computer and use it in GitHub Desktop.
/**
* Event On Modificacitons for Columns
*/
// Remove the Default WordPress Columns
add_filter('manage_ajde_events_posts_columns', function ( $columns )
{
unset($columns['author'], $columns['tags']);
return $columns;
} );
// Remove the EventOn Event Type 2 column
function manage_evo_event_columns( $columns ) {
unset($columns['event_type_2']);
return $columns;
}
add_filter( 'evo_event_columns', 'manage_evo_event_columns' );
// Add new Column into Events Custom Post Type
function price_columns_head($defaults) {
$defaults['price_column'] = 'Price';
return $defaults;
}
// Show the price field to the new Column
function price_columns_content($column_name, $post_ID) {
global $post;
if ($column_name == 'price_column') {
$pricepoint = get_post_meta($post->ID, 'evotx_price',true);
echo '$'.$pricepoint;
}
}
// Add Price Column to Events
add_filter('manage_ajde_events_posts_columns', 'price_columns_head', 10);
add_action('manage_ajde_events_posts_custom_column', 'price_columns_content', 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment