2017-10-01 7 views
3

나는 wpcasa 인 나의 프로젝트를 위해 wordpress real estate plugin을 사용하고있다. 나는 이미 약간의 수정을하고있다. 그러나이 것은 내 시간이 필요하다.검색 폼에 기본값을 설정하는 방법은 무엇입니까?

나는 배열을 사용하여 검색 양식에 값/레이블을 설정했다고 생각합니다. 누구든지 검색 양식에 기본값을 추가하는 방법에 대해 도움을받을 수 있습니까?

은 여기에 값 HOME은 대신 라벨을 보여주는 설정합니다 키워드

$defaults = array(   
      'keyword' => array(
       'label'   => __('Keyword or Listing ID', 'wpcasa') . '…', 
       'type'   => 'text', 
       'class'   => 'width-3-4', 
       'priority'  => 10 
      ),   
      'submit' => array(
       'label'   => __('Search', 'wpcasa'), 
       'type'   => 'submit', 
       'class'   => 'width-1-4', 
       'priority'  => 20 
      ), 
      'offer' => array(
       'label'   => __('Offer', 'wpcasa'), 
       'key'   => '_price_offer', 
       'data'   => wpsight_offers(), 
       'type'   => 'select', 
       'data_compare' => '=', 
       'class'   => 'width-1-5', 
       'priority'  => 30 
      ), 
      'location' => array(
       'data'   => array(
        // wp_dropdown_categories() options 
        'taxonomy'   => 'location', 
        'show_option_none' => __('Location', 'wpcasa'), 
        'option_none_value' => '', 
        'hierarchical'  => 1, 
        'orderby'   => 'ID', 
        'order'    => 'ASC' 
       ), 
       'type'   => 'taxonomy_select', 
       'class'   => 'width-1-5', 
       'priority'  => 40 
      ), 
      'listing-type' => array(
       'data'   => array(
        // wp_dropdown_categories() options 
        'taxonomy'   => 'listing-type', 
        'show_option_none' => __('Type', 'wpcasa'), 
        'option_none_value' => '', 
        'hierarchical'  => 1, 
        'orderby'   => 'ID', 
        'order'    => 'ASC' 
       ), 
       'type'   => 'taxonomy_select', 
       'class'   => 'width-1-5', 
       'priority'  => 50 
      ), 
      $details['details_1']['id'] => array(
       'label'   => $details['details_1']['label'], 
       'key'   => '_details_1', 
       'data'   => $details['details_1']['data'], 
       'type'   => 'select', 
       'data_compare' => '>=', 
       'class'   => 'width-1-5', 
       'priority'  => 60 
      ), 
      $details['details_2']['id'] => array(
       'label'   => $details['details_2']['label'], 
       'key'   => '_details_2', 
       'data'   => $details['details_2']['data'], 
       'type'   => 'select', 
       'data_compare' => '>=', 
       'class'   => 'width-1-5', 
       'priority'  => 70 
      )   
     ); 
` 

예 아래의 코드입니다.

감사합니다.

+0

코드를 두 번 복사했습니다. 예제 중 하나를 제거하십시오. – alexi2

+0

@ alexi2 감사합니다 :) –

+0

검색 양식의 기본값은 무엇입니까? 자리 표시 자? –

답변

0

나는 그것이 지금은 '기본'=> 'Myvalue'도움말/조언을

'keyword' => array(
       'label'   => __('Keyword or Listing ID', 'wpcasa') . '…', 
       'type'   => 'text', 
       'class'   => 'width-3-4', 
       'default'  => 'HELLO', 
       'priority'  => 10 
      ),  

감사

예를 추가해야합니다있어!