BuddyDev

Search

[Resolved] Allow Comments – How I added No as an option

  • Participant
    Level: Enlightened
    Posts: 56
    John B on #24944

    When a user creates a new blog post, I wanted them to have the option to select Yes and No under the Allow Comments section. Here’s how I added that.

    \wp-content\plugins\bp-simple-front-end-post\form.php

    Line 108:

    <label for="bp-simple-post-comment-status">
                            <input id="bp-simple-post-comment-status" name="bp_simple_post_comment_status" type="radio"
                                   value="open" <?php echo checked( 'closed', $current_status ); ?> /> <?php _e( 'Yes', 'bp-simple-front-end-post' ); ?>
    					</label>

    Changed to:

    <label for="bp-simple-post-comment-status">
                            <input id="bp-simple-post-comment-status" name="bp_simple_post_comment_status" type="radio"
                                   value="open" <?php echo checked( 'closed', $current_status ); ?> /> <?php _e( 'Yes', 'bp-simple-front-end-post' ); ?>
    					</label>
    					
    					<label>
    						
    						<input id="bp-simple-post-comment-status" name="bp_simple_post_comment_status" type="radio"
                                   value="closed" <?php echo checked( 'closed', $current_status ); ?> /> <?php _e( 'No', 'bp-simple-front-end-post' ); ?>
                        </label>
  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #24975

    Hi John,
    Since checkbox represents Yes/no, we used it.

    Your implementation is correct too as you have moved from checkbox to radio. Thank you for sharing.

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: resolved