• 1.
    <?php
  • 2.
    /**
  • 3.
     * The template for displaying answer submit form
  • 4.
     *
  • 5.
     * @package DW Question & Answer
  • 6.
     * @since DW Question & Answer 1.0.1
  • 7.
     */
  • 8.
    ?>
  • 9.
     
  • 10.
    <div class="dwqa-answer-form">
  • 11.
        <?php do_action( 'dwqa_before_answer_submit_form' ); ?>
  • 12.
        <div class="dwqa-answer-form-title"><?php _e( 'Your Answer', 'dwqa' ) ?></div>
  • 13.
        <form name="dwqa-answer-form" id="dwqa-answer-form" method="post" enctype="multipart/form-data">
  • 14.
            <?php dwqa_print_notices(); ?>
  • 15.
            <?php $content = isset( $_POST['answer-content'] ) ? $_POST['answer-content'] : ''; ?>
  • 16.
            <?php dwqa_init_tinymce_editor( array( 'content' => $content, 'textarea_name' => 'answer-content', 'id' => 'dwqa-answer-content' ) ) ?>
  • 17.
           
  • 18.
     
  • 19.
            <?php if ( dwqa_current_user_can( 'post_answer' ) && !is_user_logged_in() ) : ?>
  • 20.
            <p>
  • 21.
                <label for="user-email"><?php _e( 'Your Email', 'dwqa' ) ?></label>
  • 22.
                <?php $email = isset( $_POST['user-email'] ) ? $_POST['user-email'] : ''; ?>
  • 23.
                <input type="email" class="dwqa-question-anonymous-email" name="user-email" value="<?php echo $email ?>">
  • 24.
            </p>
  • 25.
            <p>
  • 26.
                <label for="user-name"><?php _e( 'Your Name', 'dwqa' ) ?></label>
  • 27.
                <?php $name = isset( $_POST['user-name'] ) ? $_POST['user-name'] : ''; ?>
  • 28.
                <input type="text" class="dwqa-question-anonymous-name" name="user-name" value="<?php echo $name ?>" >
  • 29.
            </p>
  • 30.
            <?php endif; ?>
  • 31.
           
  • 32.
            <?php if ( is_user_logged_in() ) : ?>
  • 33.
            <select class="dwqa-select" name="dwqa-status">
  • 34.
                <optgroup label="<?php _e( 'Who can see this?', 'dwqa' ) ?>">
  • 35.
                    <option value="publish"><?php _e( 'Public', 'dwqa' ) ?></option>
  • 36.
                    <option value="private"><?php _e( 'Only Me &amp; Admin', 'dwqa' ) ?></option>
  • 37.
                </optgroup>
  • 38.
            </select>
  • 39.
            <?php endif; ?>
  • 40.
            <?php dwqa_load_template( 'captcha', 'form' ); ?>
  • 41.
            <?php do_action( 'dwqa_before_answer_submit_button' ); ?>
  • 42.
           
  • 43.
            <input type="submit" name="submit-answer" class="dwqa-btn dwqa-btn-primary" value="<?php _e( 'Submit', 'dwqa' ) ?>">
  • 44.
            <input type="hidden" name="question_id" value="<?php the_ID(); ?>">
  • 45.
            <input type="hidden" name="dwqa-action" value="add-answer">
  • 46.
            <?php wp_nonce_field( '_dwqa_add_new_answer' ) ?>
  • 47.
        </form>
  • 48.
        <?php do_action( 'dwqa_after_answer_submit_form' ); ?>
  • 49.
    </div>
  • 50.
     
  • 51.
     
<?php /** * The template for displaying answer submit form * * @package DW Question & Answer * @since DW Question & Answer 1.0.1 */ ?> <div class="dwqa-answer-form"> <?php do_action( 'dwqa_before_answer_submit_form' ); ?> <div class="dwqa-answer-form-title"><?php _e( 'Your Answer', 'dwqa' ) ?></div> <form name="dwqa-answer-form" id="dwqa-answer-form" method="post" enctype="multipart/form-data"> <?php dwqa_print_notices(); ?> <?php $content = isset( $_POST['answer-content'] ) ? $_POST['answer-content'] : ''; ?> <?php dwqa_init_tinymce_editor( array( 'content' => $content, 'textarea_name' => 'answer-content', 'id' => 'dwqa-answer-content' ) ) ?> <?php if ( dwqa_current_user_can( 'post_answer' ) && !is_user_logged_in() ) : ?> <p> <label for="user-email"><?php _e( 'Your Email', 'dwqa' ) ?></label> <?php $email = isset( $_POST['user-email'] ) ? $_POST['user-email'] : ''; ?> <input type="email" class="dwqa-question-anonymous-email" name="user-email" value="<?php echo $email ?>"> </p> <p> <label for="user-name"><?php _e( 'Your Name', 'dwqa' ) ?></label> <?php $name = isset( $_POST['user-name'] ) ? $_POST['user-name'] : ''; ?> <input type="text" class="dwqa-question-anonymous-name" name="user-name" value="<?php echo $name ?>" > </p> <?php endif; ?> <?php if ( is_user_logged_in() ) : ?> <select class="dwqa-select" name="dwqa-status"> <optgroup label="<?php _e( 'Who can see this?', 'dwqa' ) ?>"> <option value="publish"><?php _e( 'Public', 'dwqa' ) ?></option> <option value="private"><?php _e( 'Only Me &amp; Admin', 'dwqa' ) ?></option> </optgroup> </select> <?php endif; ?> <?php dwqa_load_template( 'captcha', 'form' ); ?> <?php do_action( 'dwqa_before_answer_submit_button' ); ?> <input type="submit" name="submit-answer" class="dwqa-btn dwqa-btn-primary" value="<?php _e( 'Submit', 'dwqa' ) ?>"> <input type="hidden" name="question_id" value="<?php the_ID(); ?>"> <input type="hidden" name="dwqa-action" value="add-answer"> <?php wp_nonce_field( '_dwqa_add_new_answer' ) ?> </form> <?php do_action( 'dwqa_after_answer_submit_form' ); ?> </div>

Copy Code to Clipboard Raw

Sign-in or Create a Free Account.

Snippi uses Twitter or Facebook to register and create accounts. Registration will enable you to keep track of your snippets. We never spam your timeline or wall. Ever.

Sign-in with Facebook Sign-in with Twitter