• Resolved tanckom

    (@tanckom)


    Hello,

    So i was wondering if it’s possible to change several Texts in the website.com/adverts/add page?

    For example changing “Item Information” to product information, or “Description” to “Tell us more about your product”?

    Is it also possible to add the “boxs needs to be filled out” thing to other boxes?

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    Hi, you can change the texts labels either using Custom Fields https://wpadverts.com/documentation/custom-fields/ or you can do English to English translation for phrases you want to change only https://wpadverts.com/documentation/translating-to-your-language/

    Plugin Author Greg Winiarski

    (@gwin)

    I missed your question about making fields required, you can make some fields required using the code snippet below

    
    add_filter( "adverts_form_load", "customize_adverts_add" );
    function customize_adverts_add( $form ) {
      if( $form['name'] != "advert" ) {
        return $form;
      }
      
      $required = array("adverts_price", "adverts_location"); 
    
      foreach( $form["field"] as $key => $field ) {
        if( in_array( $field["name"], $required ) ) {
            if( ! isset( $form["field"][$key]["validator"] ) ) {
                $form["field"][$key]["validator"] = array();
            }
            $form["field"][$key]["validator"][] = array( "name" => "is_required" );
        }
      }
      return $form;
    }
    

    This will make price and location fields required, if you want to make some other fields required as well then you will need to add their names to $required variable.

    Thread Starter tanckom

    (@tanckom)

    Thanks, ill try ??

    Thread Starter tanckom

    (@tanckom)

    This wont change the text, but its more to create new custom fields :/
    https://wpadverts.com/documentation/custom-fields/

    Thread Starter tanckom

    (@tanckom)

    Oh, found it bymyself:

    Open this file:
    wpadverts/includes/defaults.php

    And there you can find after line 24 all the post titles, Item information etc. which you can change in the text you want.

    To add the “field required”, simply add this code:

    "validator" => array(
                    array( "name"=> "is_required" )
                )

    To every array block, that doesnt have one. Make sure that there’s a “,” before each validator…

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Add advertise Form (change texts)’ is closed to new replies.