WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Business Directory] remove 'required' fields (4 posts)

  1. tsl123
    Member
    Posted 3 years ago #

    Hi

    I need to know how I can either stop certain required fields from being displayed or remove the requirement for certain feilds to be completed.

    For instance you have to complete website, phone number or email, but if it has already been entered in to the description I don't want the information to be displayed again.

    I hope this makes sense!

    Cheers
    tony

  2. bsohal
    Member
    Posted 3 years ago #

    I think it cannot be set on or off like pluggable. You should modify the code to do this.
    Probably : change in function validateListing($v,$admin = false) in functions.php

  3. domher
    Member
    Posted 3 years ago #

    I would like to be able to do this, too.

  4. pmagony
    Member
    Posted 2 years ago #

    I was able to successfully do this by editing /wp-content/plugins/business-directory/function.php

    In line blocks 14 - 32, you'll have the construction of the form itself. Locate the asterisks for the fields and delete them. This will remove the asterisks from the front-end and the user getting misinformed that a field is required when it indeed will not be.

    Next

    Line 777 - 810 will contain the actual validation check statements. Simply comment out the lines that you do not want the script to validate for. Here is an example, where I commented out the "Description" field requirement on Line: 794 - 798:

    /*if(empty($v["description"]))
    		$errors[] = empty($post["description"])?
    			"Please enter a brief description for the organization.<br/>":
    			"Invalid character(s) in $adjective description.<br/>"
    		;*/

Topic Closed

This topic has been closed to new replies.

About this Topic