-
-
Save WadeTheFade/5545dacb9c0843f9d2eca606dc1cc43b to your computer and use it in GitHub Desktop.
class-form-hooks.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ( ! $editing ) { | |
$question_args['post_type'] = 'question'; | |
//$question_args["post_status"] = "draft"; | |
$post_id = wp_insert_post( $question_args, true ); | |
$postToTransition = get_post( $post_id ); | |
clean_post_cache($postToTransition->ID); | |
//Need to update post via $WPDB or a method here | |
//anspress()->query->updatePost("publish", $postToTransition); | |
wp_transition_post_status( "publish", "draft", $postToTransition); | |
} else { | |
$post_id = wp_update_post( $question_args, true ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ( ! $editing ) { | |
$question_args['post_type'] = 'question'; | |
$post_id = wp_insert_post( $question_args, true ); | |
} else { | |
$post_id = wp_update_post( $question_args, true ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment