Created
September 29, 2019 16:45
-
-
Save Basilakis/9456d8e8b53cd47a3d28fb53eda0ebb6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/** | |
* 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