Guest User

Untitled

a guest
Jan 18th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. <?php
  2. /**
  3. * Property search form
  4. *
  5. * @author PropertyHive
  6. * @package PropertyHive/Templates
  7. * @version 1.0.0
  8. */
  9.  
  10. if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
  11.  
  12. if ( is_post_type_archive('property') )
  13. {
  14. $department = get_option( 'propertyhive_primary_department' );
  15.  
  16. if ( isset( $_REQUEST['department'] ) && $_REQUEST['department'] != '' )
  17. {
  18. $department = $_REQUEST['department'];
  19. }
  20.  
  21. $department = str_replace('residential-', '', $department);
  22.  
  23. echo do_shortcode('[property_search_form id="' . $department . '"]');
  24. }
  25. else
  26. {
  27. ?>
  28.  
  29. <form name="ph_property_search" class="property-search-form property-search-form-<?php echo $id; ?> clear" action="<?php echo get_post_type_archive_link( 'property' ); ?>" method="get" role="form">
  30.  
  31. <?php foreach ( $form_controls as $key => $field ) : ?>
  32.  
  33. <?php ph_form_field( $key, $field ); ?>
  34.  
  35. <?php endforeach; ?>
  36.  
  37. <input type="submit" value="<?php _e( 'Search', 'propertyhive' ); ?>">
  38.  
  39. </form>
  40. <?php } ?>
Add Comment
Please, Sign In to add comment