| 1 |
<?php |
| 2 |
/** |
| 3 |
* PropertyHive Template Hooks |
| 4 |
* |
| 5 |
* Action/filter hooks used for PropertyHive functions/templates |
| 6 |
* |
| 7 |
* @author PropertyHive |
| 8 |
* @category Core |
| 9 |
* @package PropertyHive/Templates |
| 10 |
* @version 1.0.0 |
| 11 |
*/ |
| 12 |
|
| 13 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
| 14 |
|
| 15 |
add_filter( 'body_class', 'ph_body_class' ); |
| 16 |
add_filter( 'post_class', 'ph_property_post_class', 20, 3 ); |
| 17 |
|
| 18 |
/** |
| 19 |
* PH Header |
| 20 |
* |
| 21 |
* @see ph_products_rss_feed() |
| 22 |
* @see ph_generator_tag() |
| 23 |
*/ |
| 24 |
add_action( 'wp_head', 'ph_properties_rss_feed' ); |
| 25 |
add_action( 'get_the_generator_html', 'ph_generator_tag', 10, 2 ); |
| 26 |
add_action( 'get_the_generator_xhtml', 'ph_generator_tag', 10, 2 ); |
| 27 |
|
| 28 |
/** |
| 29 |
* Content Wrappers |
| 30 |
* |
| 31 |
* @see propertyhive_output_content_wrapper() |
| 32 |
* @see propertyhive_output_content_wrapper_end() |
| 33 |
*/ |
| 34 |
add_action( 'propertyhive_before_main_content', 'propertyhive_output_content_wrapper', 10 ); |
| 35 |
add_action( 'propertyhive_after_main_content', 'propertyhive_output_content_wrapper_end', 10 ); |
| 36 |
|
| 37 |
/** |
| 38 |
* Properties Loop |
| 39 |
* |
| 40 |
* @see propertyhive_result_count() |
| 41 |
* @see propertyhive_catalog_ordering() |
| 42 |
*/ |
| 43 |
add_action( 'propertyhive_before_search_results_loop', 'propertyhive_search_form', 10 ); |
| 44 |
add_action( 'propertyhive_before_search_results_loop', 'propertyhive_result_count', 20 ); |
| 45 |
add_action( 'propertyhive_before_search_results_loop', 'propertyhive_catalog_ordering', 30 ); |
| 46 |
|
| 47 |
|
| 48 |
/** |
| 49 |
* Pagination after search loops |
| 50 |
* |
| 51 |
* @see propertyhive_pagination() |
| 52 |
*/ |
| 53 |
add_action( 'propertyhive_after_search_results_loop', 'propertyhive_pagination', 10 ); |
| 54 |
|
| 55 |
/** |
| 56 |
* Property Loop Items |
| 57 |
* |
| 58 |
* @see propertyhive_template_loop_property_thumbnail() |
| 59 |
* @see propertyhive_template_loop_floor_area() |
| 60 |
* @see propertyhive_template_loop_price() |
| 61 |
* @see propertyhive_template_loop_summary() |
| 62 |
* @see propertyhive_template_loop_actions() |
| 63 |
*/ |
| 64 |
add_action( 'propertyhive_before_search_results_loop_item_title', 'propertyhive_template_loop_property_thumbnail', 10 ); |
| 65 |
|
| 66 |
add_action( 'propertyhive_after_search_results_loop_item_title', 'propertyhive_template_loop_floor_area', 5 ); // commercial only |
| 67 |
add_action( 'propertyhive_after_search_results_loop_item_title', 'propertyhive_template_loop_price', 10 ); |
| 68 |
add_action( 'propertyhive_after_search_results_loop_item_title', 'propertyhive_template_loop_summary', 20 ); |
| 69 |
add_action( 'propertyhive_after_search_results_loop_item_title', 'propertyhive_template_loop_actions', 30 ); |
| 70 |
|
| 71 |
/** |
| 72 |
* Featured Property Loop Items |
| 73 |
* |
| 74 |
* @see propertyhive_template_loop_property_thumbnail() |
| 75 |
* @see propertyhive_template_loop_price() |
| 76 |
* @see propertyhive_template_loop_actions() |
| 77 |
*/ |
| 78 |
add_action( 'propertyhive_before_featured_loop_item_title', 'propertyhive_template_loop_property_thumbnail', 10 ); |
| 79 |
|
| 80 |
add_action( 'propertyhive_after_featured_loop_item_title', 'propertyhive_template_loop_price', 10 ); |
| 81 |
add_action( 'propertyhive_after_featured_loop_item_title', 'propertyhive_template_loop_actions', 30 ); |
| 82 |
|
| 83 |
/** |
| 84 |
* Recent Property Loop Items |
| 85 |
* |
| 86 |
* @see propertyhive_template_loop_property_thumbnail() |
| 87 |
* @see propertyhive_template_loop_price() |
| 88 |
* @see propertyhive_template_loop_actions() |
| 89 |
*/ |
| 90 |
add_action( 'propertyhive_before_recent_loop_item_title', 'propertyhive_template_loop_property_thumbnail', 10, 2 ); |
| 91 |
|
| 92 |
add_action( 'propertyhive_after_recent_loop_item_title', 'propertyhive_template_loop_price', 10 ); |
| 93 |
add_action( 'propertyhive_after_recent_loop_item_title', 'propertyhive_template_loop_actions', 20 ); |
| 94 |
|
| 95 |
/** |
| 96 |
* Before Single Property Summary Div |
| 97 |
* |
| 98 |
* @see propertyhive_template_not_on_market() |
| 99 |
* @see propertyhive_show_property_images() |
| 100 |
* @see propertyhive_show_property_thumbnails() |
| 101 |
*/ |
| 102 |
add_action( 'propertyhive_before_single_property_summary', 'propertyhive_template_not_on_market', 5 ); |
| 103 |
add_action( 'propertyhive_before_single_property_summary', 'propertyhive_show_property_images', 10 ); |
| 104 |
add_action( 'propertyhive_product_thumbnails', 'propertyhive_show_property_thumbnails', 20 ); |
| 105 |
|
| 106 |
/** |
| 107 |
* Property Summary Box |
| 108 |
* |
| 109 |
* @see propertyhive_template_single_title() |
| 110 |
* @see propertyhive_template_single_floor_area() |
| 111 |
* @see propertyhive_template_single_price() |
| 112 |
* @see propertyhive_template_single_meta() |
| 113 |
* @see propertyhive_template_single_sharing() |
| 114 |
*/ |
| 115 |
add_action( 'propertyhive_single_property_summary', 'propertyhive_template_single_title', 5 ); |
| 116 |
add_action( 'propertyhive_single_property_summary', 'propertyhive_template_single_floor_area', 7 ); // commercial only |
| 117 |
add_action( 'propertyhive_single_property_summary', 'propertyhive_template_single_price', 10 ); |
| 118 |
add_action( 'propertyhive_single_property_summary', 'propertyhive_template_single_meta', 20 ); |
| 119 |
add_action( 'propertyhive_single_property_summary', 'propertyhive_template_single_sharing', 30 ); |
| 120 |
|
| 121 |
/** |
| 122 |
* After Single Property Summary Div |
| 123 |
* |
| 124 |
* @see propertyhive_template_single_actions() |
| 125 |
* @see propertyhive_template_single_features() |
| 126 |
* @see propertyhive_template_single_summary() |
| 127 |
* @see propertyhive_template_single_description() |
| 128 |
*/ |
| 129 |
add_action( 'propertyhive_after_single_property_summary', 'propertyhive_template_single_actions', 10 ); |
| 130 |
add_action( 'propertyhive_after_single_property_summary', 'propertyhive_template_single_features', 20 ); |
| 131 |
add_action( 'propertyhive_after_single_property_summary', 'propertyhive_template_single_summary', 30 ); |
| 132 |
add_action( 'propertyhive_after_single_property_summary', 'propertyhive_template_single_description', 40 ); |
| 133 |
|
| 134 |
/** |
| 135 |
* Property Actions Box |
| 136 |
* |
| 137 |
* @see propertyhive_make_enquiry_button() |
| 138 |
*/ |
| 139 |
add_action( 'propertyhive_property_actions_list_start', 'propertyhive_make_enquiry_button', 10 ); |
| 140 |
|
| 141 |
/** |
| 142 |
* My Account |
| 143 |
* |
| 144 |
* @see propertyhive_my_account_navigation() |
| 145 |
* @see propertyhive_my_account_sections() |
| 146 |
*/ |
| 147 |
add_action( 'propertyhive_my_account_content', 'propertyhive_my_account_navigation', 10 ); |
| 148 |
add_action( 'propertyhive_my_account_content', 'propertyhive_my_account_sections', 20 ); |
| 149 |
|
| 150 |
add_action( 'propertyhive_my_account_section_dashboard', 'propertyhive_my_account_dashboard', 10 ); |
| 151 |
add_action( 'propertyhive_my_account_section_details', 'propertyhive_my_account_details', 10 ); |
| 152 |
add_action( 'propertyhive_my_account_section_requirements', 'propertyhive_my_account_requirements', 10 ); |
| 153 |
add_action( 'propertyhive_my_account_section_applicant_viewings', 'propertyhive_my_account_applicant_viewings', 10 ); |
| 154 |
add_action( 'propertyhive_my_account_section_owner_properties', 'propertyhive_my_account_owner_properties', 10 ); |
| 155 |
add_action( 'propertyhive_my_account_section_owner_viewings', 'propertyhive_my_account_owner_viewings', 10 ); |
| 156 |
add_action( 'propertyhive_my_account_section_delete', 'propertyhive_my_account_delete', 10 ); |
| 157 |
|
| 158 |
/** |
| 159 |
* Footer |
| 160 |
* |
| 161 |
* @see ph_print_js() |
| 162 |
*/ |
| 163 |
//add_action( 'wp_footer', 'ph_print_js', 25 ); |
| 164 |
|