This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'propertyhive_email_schedule_user_query', 'exclude_us' ); | |
| function exclude_us($args) | |
| { | |
| $args['exclude'] = array(1); // change 1 accordingly to your WordPress user ID | |
| return $args; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'propertyhive_single_property_actions', 'remove_floorplans_and_virtual_tours_action' ); | |
| function remove_floorplans_and_virtual_tours_action( $actions ) | |
| { | |
| foreach ( $actions as $i => $action ) | |
| { | |
| if ( | |
| isset( $action['class'] ) && | |
| ( | |
| $action['class'] === 'action-floorplans' || | |
| $action['class'] === 'action-virtual-tour' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action( "houzez_property_feed_property_imported_resales_online", 'custom_features_structure', 10, 4 ); | |
| function custom_features_structure($post_id, $property, $import_id, $instance_id) | |
| { | |
| $feature_term_ids = array(); | |
| if ( isset($property->characteristics->category) ) | |
| { | |
| foreach ( $property->characteristics->category as $category ) | |
| { | |
| if ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter('propertyhive_property_map_osm_icon_width', function ($w) { | |
| return 40; | |
| }); | |
| add_filter('propertyhive_property_map_osm_icon_height', function ($h) { | |
| return 40; | |
| }); | |
| add_filter('propertyhive_property_map_osm_icon_anchor_width', function ($aw) { | |
| return 20; // half of width |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( "houzez_property_feed_properties_due_import_resales_online", 'malaga_only', 10, 2 ); | |
| function malaga_only($properties, $import_id) | |
| { | |
| $new_properties = array(); | |
| foreach ( $properties as $property ) | |
| { | |
| if ( (string)$property->province == 'Málaga' ) | |
| { | |
| $new_properties[] = $property; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'houzez_property_feed_insert_postarr', 'draft_on_insert', 10, 3 ); | |
| function draft_on_insert( $data, $property, $import_id ) | |
| { | |
| $data['post_status'] = 'draft'; | |
| return $data; | |
| } | |
| add_filter( 'houzez_property_feed_update_postarr', 'keep_title_content_and_status', 10, 4 ); | |
| function keep_title_content_and_status($data, $property, $import_id, $post_id) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Setup two separate URLs | |
| add_action( 'init', 'ph_add_rewrite_rules' ); | |
| function ph_add_rewrite_rules() | |
| { | |
| global $wp_rewrite; | |
| // Setup Sales URL '/sales/' | |
| add_rewrite_rule( "sales/?$", "index.php?post_type=property&department=residential-sales", 'top' ); | |
| add_rewrite_rule( "sales/{$wp_rewrite->pagination_base}/([0-9]{1,})/?$", "index.php?post_type=property&department=residential-sales" . '&paged=$matches[1]', 'top' ); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action( "propertyhive_sturents_v2_property_imported", 'hardcode_title_and_to_eur', 10, 2 ); | |
| function hardcode_title_and_to_eur($post_id, $property) | |
| { | |
| // Set title to room type | |
| $my_post = array( | |
| 'ID' => $post_id, | |
| 'post_title' => wp_strip_all_tags( $property['room_type'] ), | |
| 'post_excerpt' => $property['description'], | |
| 'post_content' => '', | |
| 'post_status' => 'publish', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'propertyhive_locate_template', 'intercept_ph_template', 10, 3 ); | |
| function intercept_ph_template( $template, $template_name, $template_path ) | |
| { | |
| if ( 'loop-start.php' === basename( $template ) ) { | |
| $template = trailingslashit( plugin_dir_path( __FILE__ ) ) . 'ph/templates/search/loop-start.php'; | |
| } | |
| if ( 'loop-end.php' === basename( $template ) ) { | |
| $template = trailingslashit( plugin_dir_path( __FILE__ ) ) . 'ph/templates/search/loop-end.php'; | |
| } | |
| return $template; |
NewerOlder