Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * When processing Gravity Form #7 update Offer (which is a custom post type) post status to accepted (which is a custom post status)
- *
- * @since 1.0.0
- */
- function oxygen_child_accept_offer ( $entry, $form ) {
- $gf_offer_id = $entry[4]; // Offer ID (hidden field), must be dynamically populated with the post ID for this to work
- global $wp_query, $post;
- if ( $gf_offer_id ) {
- // Update the Offer with the status accepted ****************************
- $offer_post = array(
- 'ID' => $gf_offer_id,
- 'post_status' => 'accepted',
- // this is a custom status, it could have been 'publish','draft', etc.
- );
- wp_update_post( $offer_post );
- // ****************************************************************************************************
- }
- }
- // Gravity Form #7, change the ID to your form's ID
- add_action( 'gform_after_submission_7', 'oxygen_child_accept_offer', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment