Free Directory, Listing & Classifieds WordPress Plugin Support Themes ListingHive Make Description Field optional on Listing submit form

Make Description Field optional on Listing submit form

  • Author
    Posts
  • norulesatall

    Hi,

    I would want to have ‘Description’ field optional on the listing submit and update form. I am using this :

    add_filter( ‘hivepress/v1/forms/listing_submit’,
    function( $form ) {
    $form[‘fields’][‘description’][‘required’] = false;
    return $form;
    }
    );

    It still throws the message “Description is required”

    Please suggest a fix.

    norulesatall

    I could figure it out.. I changed

    add_filter( ‘hivepress/v1/forms/listing_submit’, to

    add_filter( ‘hivepress/v1/model/listing’,

    and it worked..

    ihor developer

    Yes, sorry for the late reply, this should work for the “hivepress/v1/models/listing” filter.

    shenei

    I still didn’t get. It still throws the message “Description is required”. Which complete code should I use?

    norulesatall

    use this. It should work.

    add_filter(
    	'hivepress/v1/models/listing',
    	function( $form ) {
    		$form['fields']['description']['required'] = false;
    
    		return $form;
    	}
    );
    shenei

    Thank you so much! It worked.

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Make Description Field optional on Listing submit form’ is closed to new replies.

Subscribe

Sign In

Don't have an account? Register

Forgot password?

Register

Already have an account? Sign In

Forgot password?

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.