Ah yeah, I see my suggestion for that now in previous replies. Sorry for missing that ??
From the looks of it, we call this function:
function badgeos_save_submission_data() {
// If form items don't exist, bail.
if ( ! isset( $_POST['badgeos_submission_submit'] ) || ! isset( $_POST['badgeos_submission_content'] ) ) {
return;
}
// Nonce check for security
check_admin_referer( 'badgeos_submission_form', 'submit_submission' );
// Publish the submission
return badgeos_create_submission(
absint( $_POST['achievement_id'] ),
sprintf( '%1$s: %2$s', get_post_type( absint( $_POST['achievement_id'] ) ), get_the_title( absint( $_POST['achievement_id'] ) ) ),
esc_textarea( $_POST['badgeos_submission_content'] ),
absint( $_POST['user_id'] )
);
}
from within the output for the Submission form shortcode. However, it’s not going to match up as well with your version, so you will probably need to create your own callback on like the init
action that checks for the form field values and acts appropriately afterwards. I’d mimic the function above a lot simply for the sake of having much of the code written already. I’d definitely consider changing the badgeos_submission_content
field name, to prevent duplicate submissions from potentially occurring with badgeos_save_submission_data
. However, that’s also going to cause issues with the “Submission saved successfully” output, exposing an area where our user-customization is not optimal.
Hopefully this sort-of-rambling gives you some ideas. I have enhancement issues to file ??