PluginProbe
Property Hive / trunk
Property Hive vtrunk
2.2.6 2.2.5 2.2.4 2.2.3 2.2.2 1.4.46 1.4.47 1.4.48 1.4.49 1.4.5 1.4.50 1.4.51 1.4.52 1.4.53 1.4.54 1.4.55 1.4.56 1.4.57 1.4.58 1.4.59 1.4.6 1.4.60 1.4.61 1.4.62 1.4.63 All 259 releases
propertyhive / includes / ph-conditional-functions.php

ph-conditional-functions.php in Property Hive trunk, at includes/ph-conditional-functions.php

62 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * PropertyHive Conditional Functions
4 *
5 * Functions for determining the current query/page.
6 *
7 * @author PropertyHive
8 * @category Core
9 * @package PropertyHive/Functions
10 * @version 1.0.0
11 */
12
13 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
14
15 /**
16 * is_propertyhive - Returns true if on a page which uses PropertyHive templates
17 *
18 * @access public
19 * @return bool
20 */
21 function is_propertyhive() {
22 return apply_filters( 'is_propertyhive', ( is_search_results() || is_property() ) ? true : false );
23 }
24
25 if ( ! function_exists( 'is_search_results' ) ) {
26
27 /**
28 * is_search_results - Returns true when viewing the property archive (search results).
29 *
30 * @access public
31 * @return bool
32 */
33 function is_search_results() {
34 return ( is_post_type_archive( 'property' ) || is_page( ph_get_page_id( 'search_results' ) ) ) ? true : false;
35 }
36 }
37
38 if ( ! function_exists( 'is_property' ) ) {
39
40 /**
41 * is_product - Returns true when viewing a single product.
42 *
43 * @access public
44 * @return bool
45 */
46 function is_property() {
47 return is_singular( array( 'property' ) );
48 }
49 }
50
51 if ( ! function_exists( 'is_ajax' ) ) {
52
53 /**
54 * is_ajax - Returns true when the page is loaded via ajax.
55 *
56 * @access public
57 * @return bool
58 */
59 function is_ajax() {
60 return defined( 'DOING_AJAX' );
61 }
62 }