| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Define wordpress.com VIP equivalent of uncached functions |
| 5 |
*/ |
| 6 |
|
| 7 |
if ( ! function_exists( 'wpcom_vip_get_page_by_title' ) ) { |
| 8 |
function wpcom_vip_get_page_by_title( $page_title, $output = OBJECT, $post_type = 'page' ) { |
| 9 |
return get_page_by_title( $page_title, $output, $post_type ); |
| 10 |
} |
| 11 |
} |
| 12 |
|
| 13 |
if ( ! function_exists( 'wpcom_vip_get_category_by_slug' ) ) { |
| 14 |
function wpcom_vip_get_category_by_slug( $slug ) { |
| 15 |
return get_category_by_slug( $slug ); |
| 16 |
} |
| 17 |
} |
| 18 |
|
| 19 |
if ( ! function_exists( 'wpcom_vip_get_term_by' ) ) { |
| 20 |
function wpcom_vip_get_term_by( $field, $value, $taxonomy = '', $output = OBJECT, $filter = 'raw' ) { |
| 21 |
return get_term_by( $field, $value, $taxonomy, $output, $filter ); |
| 22 |
} |
| 23 |
} |
| 24 |
|
| 25 |
if ( ! function_exists( 'wpcom_vip_get_term_link' ) ) { |
| 26 |
function wpcom_vip_get_term_link( $term, $taxonomy = '' ) { |
| 27 |
return get_term_link( $term, $taxonomy ); |
| 28 |
} |
| 29 |
} |
| 30 |
|