Created
November 27, 2017 08:11
-
-
Save rahularyan/daf65952e084d18f7528a5c031797752 to your computer and use it in GitHub Desktop.
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
<?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