Thanks a ton. Here’s what I’ve got so far. Apologies, I’m a bit inexperienced with plugin development.
//Metabox for saving color of venue
add_action('add_meta_boxes','my_add_metabox');
function my_add_metabox(){
add_meta_box('my_id','Venue Color', 'my_metabox_callback', 'event_page_venues', 'side', 'high');
}
function my_metabox_callback(){
//Metabox's innards:
$venuecolor = eo_get_venue_meta($venue->term_id, '_venue_color',true);
//Remember to use nonces!
wp_nonce_field( 'my_venue_meta_save', 'my_plugin_nonce_field' );
?>
<label>Color:</label>
<input type="text" name="my_venue_color" value="<?php echo esc_attr($venuecolor);?>" >
<?php
}
add_action ('eventorganiser_save_venue','my_save_venue_meta');
function my_save_venue_meta( $venue_id ){
//Check permissions
$tax = get_taxonomy( 'event-venue');
if ( !current_user_can( $tax->cap->edit_terms ) )
return;
//Check nonce
check_admin_referer('my_venue_meta_save', 'my_plugin_nonce_field');
//Retrieve meta value(s)
$value = $_POST['my_venue_color'];
//Update venue meta
eo_update_venue_meta($venue_id, '_venue_color', $value);
return;
}
This has created the metabox ok, but it doesn’t seem to be storing the value yet.
Once that’s working, I’ll add the filter below that code, and whatever I save in that metabox will then become the venue color for the calendar?
Thanks again!