Created
November 27, 2017 09:04
-
-
Save rahularyan/eca657e5e0796c94ffb8850951ec1a2e 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 | |
// 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