You appear to be a bot. Output may be restricted
Description
Process a new post form submissionHandle the new post form submission
- Check fields
- Perform spam checking
- Insert post_type
- Display "thank you" message
- Optionally, send an email to the post's author
- the Add new submit button with the matching "oik_new_post-nnn" form ID has been pressed
- the nonce field has been checked
Usage
$bool = _bw_process_new_post_form_oik( $atts );
Parameters
- $atts
- ( mixed ) required –
Returns
bool true if new post added, false if form need to be redisplayed.Source
File name: oik-fields/shortcodes/oik-new.phpLines:
1 to 27 of 27
function _bw_process_new_post_form_oik( $atts) { $post_type = bw_array_get( $atts, "post_type", null ); $validated = array(); $valid = bw_validate_form_as_required( $post_type, $validated ); bw_trace2( $validated, "validated", true, BW_TRACE_DEBUG ); if ( $valid ) { $valid = bw_spam_check( $post_type, $validated ); if ( $valid ) { $post_status = bw_determine_post_status( $post_type, $validated ); $sent = bw_maybe_insert_post( $post_type, $validated, $atts ); bw_set_post_terms( $post_type, $validated, $sent ); if ( $post_status != "publish" ) { bw_notify_author_email( $atts, $validated, $valid, $sent ); } } else { $sent = true; } bw_thankyou_message( $validated, $valid, $sent ); } else { $sent = false; $displayed = bw_display_messages(); if ( !$displayed ) { p( "Invalid input. Please corrrect and retry." ); } } return( $sent ); }View on GitHub