Skip to content

Instantly share code, notes, and snippets.

@rahularyan
Created November 27, 2017 09:04
Show Gist options
  • Save rahularyan/eca657e5e0796c94ffb8850951ec1a2e to your computer and use it in GitHub Desktop.
Save rahularyan/eca657e5e0796c94ffb8850951ec1a2e to your computer and use it in GitHub Desktop.
<?php
// Make sure post is inserted.
if ( ! is_wp_error( $post_id ) ) {
$form = anspress()->get_form( 'question' );
$values = $form->get_values();
$qameta = array(
'last_updated' => current_time( 'mysql' ), // When last question was active.
'answers' => ap_count_published_answers( $post_id ), // numbers of answers.
'anonymous_name' => sanitize_text_field( $values['anonymous_name']['value'] ), // Anonymous user name.
'selected' => false, // Answer id if have a selected answer.
'views' => 10000, // Numbers of views.
'closed' => false, // Is question closed?
'comments' => 10, // Numbers of comments.
'featured' => false, // is featured?
'votes_up' => 5, // Numbers of vote up.
'votes_down' => 0, // Numbers of vote down.
'subscribers' => 10, // Numbers of subscribers.
'flags' => 0, // Numbers of flags.
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment