add_action(‘save_post’) blocked?
-
I’m trying to add a custom meta box to the events, as to add an image gallery to events. I’ve build plenty of boxes, and things work fine, except for the saving function, as data from the custom meta box is not actually saved.
Does the event calendar block custom fields to be added?
The save function is the following;function tribe_events_save_meta_boxes_data($post_id) { if (!isset($_POST['tribe_events_meta_box_nonce']) || !wp_verify_nonce($_POST['tribe_events_meta_box_nonce'], basename(__FILE__))) { return; } if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) { return; } // Check the user's permissions. if (!current_user_can('edit_post', $post_id)) { return; } if (isset($_POST['space_images'])) { update_post_meta($post_id, 'space_images', $_POST['space_images']); } else { delete_post_meta($post_id, 'space_images'); } } add_action('save_post_tribe_events', 'tribe_events_save_meta_boxes_data', 10, 2);
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘add_action(‘save_post’) blocked?’ is closed to new replies.