Skip to content

Instantly share code, notes, and snippets.

@rahularyan
Created November 27, 2017 08:11
Show Gist options
  • Save rahularyan/daf65952e084d18f7528a5c031797752 to your computer and use it in GitHub Desktop.
Save rahularyan/daf65952e084d18f7528a5c031797752 to your computer and use it in GitHub Desktop.
<?php
// Get question form object.
$form = anspress()->get_form( 'question' );
// Values.
$values = array(
'post_title' => 'Question title goes here',
'post_content' => 'Question description goes here',
'is_private' => false, // True if not private.
'category' => 5, // Id of taxonomy term.
'tags' => array(
23 => 'WordPress',
25 => 'Joomla',
27 => 'Website',
), // question_tag taxonomy term in id=>name format.
)
// Set values.
$form->set_values( $values );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment