Skip to content

Commit

Permalink
Use wp_update_post for category question saving
Browse files Browse the repository at this point in the history
  • Loading branch information
merkushin committed May 31, 2024
1 parent 969082e commit bfd0375
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,15 @@ private function save_category_question( $question ) {
],
];

$result = wp_insert_post( $post_args );
$result = wp_update_post( $post_args );

/**
* This action is triggered when a category question is created or updated by the lesson quiz REST endpoint.
*
* @since 3.9.0
* @hook sensei_rest_api_category_question_saved
*
* @param {int|WP_Error} $result Result of wp_insert_post. Post ID on success or WP_Error on failure.
* @param {int|WP_Error} $result Result of wp_update_post. Post ID on success or WP_Error on failure.
* @param {array} $question The question JSON arguments.
*/
do_action( 'sensei_rest_api_category_question_saved', $result, $question );
Expand Down

0 comments on commit bfd0375

Please sign in to comment.