BuddyDev

Search

Simple Front End Post – Make Category a Required Field

Tagged: ,

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

    I’ve been able to make the Visibility section required by adding Required to the end of the input type field.

    <label for="bp_simple_post_visibility_public">
                            <input type="radio" name="bp_simple_post_visibility" id="bp_simple_post_visibility_public"
                                   value="public" required> <?php _e( 'Public', 'bp-simple-front-end-post' ); ?>
                        </label>
    					
                        <label for="bp_simple_post_visibility_private">
                            <input type="radio" name="bp_simple_post_visibility" id="bp_simple_post_visibility_private"
                                   value="private" required> <?php _e( 'Private', 'bp-simple-front-end-post' ); ?>
                        </label>

    I’d like to make the Category section Required as well.

    Can someone please point me in the right direction?

    Thanks in advance.

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2440
    Ravi on #25199

    Hello John,

    Thank you for posting. Please refer the following URL:

    https://github.com/sbrajesh/bp-simple-front-end-post/blob/master/core/classes/class-edit-form.php#L416

    There is a filter with name ‘bsfep_validate_post’ Using this you can make category as required field.

    Regards
    Ravi

You must be logged in to reply to this topic.

This topic is: not resolved