From 18c41ca78065542b1e7acaa27ec2ac998228e27b Mon Sep 17 00:00:00 2001 From: Hoang Huu Date: Fri, 18 Oct 2019 09:24:03 +0700 Subject: [PATCH] Add placeholder hooks. --- inc/mixes-functions.php | 7 ++++++- inc/template-functions.php | 14 +++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/inc/mixes-functions.php b/inc/mixes-functions.php index 133f63c2..3d22688f 100755 --- a/inc/mixes-functions.php +++ b/inc/mixes-functions.php @@ -513,8 +513,13 @@ function opalestate_get_image_placeholder( $size = '', $url = false ) { return '' . sprintf( esc_html__( 'Placeholder %s', 'opalestate-pro' ), $size ) . ''; } +/** + * Get image placeholder src. + * + * @return string + */ function opalestate_get_image_placeholder_src() { - return OPALESTATE_PLUGIN_URL . 'assets/images/placeholder.png'; + return apply_filters( 'opalestate_get_image_placeholder_src', OPALESTATE_PLUGIN_URL . 'assets/images/placeholder.png' ); } /** diff --git a/inc/template-functions.php b/inc/template-functions.php index 0fe58b8a..3a6a6ea9 100755 --- a/inc/template-functions.php +++ b/inc/template-functions.php @@ -20,11 +20,15 @@ function opalestate_property_mortgage() { function opalestate_load_template_path( $tpl, $args = [], $layout = '' ) { return Opalestate_Template_Loader::get_template_part( $tpl, $args, $layout ); - } +/** + * Get image avatar placeholder src. + * + * @return string + */ function opalestate_get_image_avatar_placehold() { - return OPALESTATE_PLUGIN_URL . 'assets/images/avatar-placeholder.png'; + return apply_filters( 'opalestate_get_image_avatar_placeholder', OPALESTATE_PLUGIN_URL . 'assets/images/avatar-placeholder.png' ); } function opalestate_get_admin_view( $file ) { @@ -246,8 +250,8 @@ function opalestate_show_display_modes( $default = 'list' ) { if ( ! function_exists( 'opalestate_pagination' ) ) { /** - * Opalestate pagination. - * + * Opalestate pagination. + * * @param string $pages * @param int $range */ @@ -590,7 +594,7 @@ function opalestate_property_author_v2() { echo opalestate_load_template_path( 'single-property/author-v2' ); } -function opalestate_property_author_v3() { +function opalestate_property_author_v3() { echo opalestate_load_template_path( 'single-property/author-v3' ); }