Support » Plugin: The Events Calendar » 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 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.