/* * splite_notice_dismissable * Ajax action to do tasks on notice dismissable * Require class: splite-dismissable */ add_action( 'wp_ajax_splite_notice_dismissable', 'splite_notice_dismissable' ); function splite_notice_dismissable() { if(!isset($_POST['security']) || !isset($_POST['dataBtn'])) { wp_send_json_error('Security check failed, please refresh and try again'); wp_die(); } // Sanitize string for added security $data_btn = isset($_POST['dataBtn']) ? sanitize_text_field($_POST['dataBtn']) : ''; $nonce = ($data_btn=='ask-later') ? 'splite_ask_later' : 'splite_ask_never'; if(!wp_verify_nonce($_POST['security'], $nonce) || !current_user_can('manage_options')) { wp_send_json_error('Security check failed, please refresh and try again'); wp_die(); } $today = DateTime::createFromFormat('U', current_time('U')); switch($data_btn) { case 'ask-later': $ask_later = get_option('splite_review_notice') ? get_option('splite_review_notice') : 0; update_option('splite_review_notice', ++$ask_later); break; case 'ask-never': update_option('splite_review_notice', 0); break; } wp_send_json_success(); wp_die(); } /** * Show a notice to anyone who has to give a review after using the plugin for 14 days * This notice shouldn't display to who has to given a review already **/ function splite_admin_notices() { $install_date = get_option('splite_install_date', 0); $install_date_object = DateTime::createFromFormat('Y-m-d H:i:s', $install_date); // review_notice - numeric counter for multiplying 14 days $review_notice = get_option('splite_review_notice', 1); if($review_notice == 0) { return; } if(! $install_date OR ! is_a($install_date_object, 'DATETIME')) { update_option('splite_install_date', current_time('Y-m-d H:i:s')); return; } $today = DateTime::createFromFormat('U', current_time('U')); $diff = $today->diff($install_date_object); //print_r($diff); if($diff->d >= 14*$review_notice) { echo '
Hope you are enjoying - Slick Popup Lite '.get_option('splite_review_notice').'

'.esc_html__( 'Thanks for using one of the best WordPress Popup Plugin for Contact Form 7. We hope that it has been useful for you and would like you to leave review on WordPres.org website, it will help us improve the product features.', 'slick-popup' ).'

Leave a Review  Ask Later | Never Show Again

'; } } add_action( 'admin_notices', 'splite_admin_notices' ); /** * Show a notice to anyone who has just updated this plugin * This notice shouldn't display to anyone who has just installed the plugin for the first time **/ function splite_display_update_notice() { // Check the transient to see if we've just updated the plugin if(get_transient( 'splite_updated' ) ) { echo '

Thanks for updating - Slick Popup Lite

'.__( 'One of the best WordPress Popup Plugin for Contact Form 7. ', 'slick-popup' ).' Go to Settings | Import Demo Forms

'; // Save splite_install_date for already existing users (before: 1.5.3) if(!get_option('splite_install_date')) update_option('splite_install_date', current_time('Y-m-d H:i:s')); delete_transient( 'splite_updated' ); } } add_action( 'admin_notices', 'splite_display_update_notice' ); /** * Show a notice to anyone who has just installed the plugin for the first time * This notice shouldn't display to anyone who has just updated this plugin **/ function splite_display_install_notice() { // Check the transient to see if we've just activated the plugin if(get_transient( 'splite_activated' ) ) { echo '

Thanks for installing - Slick Popup Lite

'.__( 'One of the best WordPress Popup Plugin for Contact Form 7. ', 'slick-popup' ).' Go to Settings | Import Demo Forms

'; // Delete the transient so we don't keep displaying the activation message delete_transient( 'splite_activated' ); } } add_action( 'admin_notices', 'splite_display_install_notice' ); /** * Show a notice for the user who has kept the temporary grant access on for more than 14 days * This notice shouldn't display to anyone who has removed the temporary access **/ function splite_grant_access_alert() { if(!username_exists('slickpopupteam') OR !email_exists('poke@slickpopup.com')) { return; } $access_granted = get_option('splite_grant_access_time') ? get_option('splite_grant_access_time') : current_time('Y-m-d H:i:s'); $access_granted_object = DateTime::createFromFormat('Y-m-d H:i:s', $access_granted); $today = DateTime::createFromFormat('U', current_time('U')); $diff = $today->diff($access_granted_object); if($diff->days >=14) { echo '
'; echo '
'; echo '
'; echo ''; echo '
'; echo '
'; echo '

'.esc_html__('Support Team Access','slick-popup').' - Slick Popup

'; echo '

'.esc_html__('Dear User, it has been ','slick-popup').''.esc_html__('more than 14 days','slick-popup').''.esc_html__(' since you have granted access to the Support Team. We advice you to click on the revoke access button.', 'slick-popup' ); echo '

'; if(!username_exists('slickpopupteam') && !email_exists('poke@slickpopup.com')) echo ''; else echo ''; echo ''; echo '

'; echo '
'; echo '
'; echo '
'; } } add_action('admin_notices', 'splite_grant_access_alert'); ?>/** * Payment related functions. * * @since 1.0.0 */ /** * Get supported currencies. * * @since 1.2.4 * * @return array */ function wpforms_get_currencies() { $currencies = array( 'USD' => array( 'name' => esc_html__( 'U.S. Dollar', 'wpforms' ), 'symbol' => '$', 'symbol_pos' => 'left', 'thousands_separator' => ',', 'decimal_separator' => '.', 'decimals' => 2, ), 'GBP' => array( 'name' => esc_html__( 'Pound Sterling', 'wpforms' ), 'symbol' => '£', 'symbol_pos' => 'left', 'thousands_separator' => ',', 'decimal_separator' => '.', 'decimals' => 2, ), 'EUR' => array( 'name' => esc_html__( 'Euro', 'wpforms' ), 'symbol' => '€', 'symbol_pos' => 'right', 'thousands_separator' => '.', 'decimal_separator' => ',', 'decimals' => 2, ), 'AUD' => array( 'name' => esc_html__( 'Australian Dollar', 'wpforms' ), 'symbol' => '$', 'symbol_pos' => 'left', 'thousands_separator' => ',', 'decimal_separator' => '.', 'decimals' => 2, ), 'BRL' => array( 'name' => esc_html__( 'Brazilian Real', 'wpforms' ), 'symbol' => 'R$', 'symbol_pos' => 'left', 'thousands_separator' => '.', 'decimal_separator' => ',', 'decimals' => 2, ), 'CAD' => array( 'name' => esc_html__( 'Canadian Dollar', 'wpforms' ), 'symbol' => '$', 'symbol_pos' => 'left', 'thousands_separator' => ',', 'decimal_separator' => '.', 'decimals' => 2, ), 'CZK' => array( 'name' => esc_html__( 'Czech Koruna', 'wpforms' ), 'symbol' => 'Kč', 'symbol_pos' => 'right', 'thousands_separator' => '.', 'decimal_separator' => ',', 'decimals' => 2, ), 'DKK' => array( 'name' => esc_html__( 'Danish Krone', 'wpforms' ), 'symbol' => 'kr.', 'symbol_pos' => 'right', 'thousands_separator' => '.', 'decimal_separator' => ',', 'decimals' => 2, ), 'HKD' => array( 'name' => esc_html__( 'Hong Kong Dollar', 'wpforms' ), 'symbol' => '$', 'symbol_pos' => 'left', 'thousands_separator' => ',', 'decimal_separator' => '.', 'decimals' => 2, ), 'HUF' => array( 'name' => esc_html__( 'Hungarian Forint', 'wpforms' ), 'symbol' => 'Ft', 'symbol_pos' => 'right', 'thousands_separator' => '.', 'decimal_separator' => ',', 'decimals' => 2, ), 'ILS' => array( 'name' => esc_html__( 'Israeli New Sheqel', 'wpforms' ), 'symbol' => '₪', 'symbol_pos' => 'left', 'thousands_separator' => ',', 'decimal_separator' => '.', 'decimals' => 2, ), 'MYR' => array( 'name' => esc_html__( 'Malaysian Ringgit', 'wpforms' ), 'symbol' => 'RM', 'symbol_pos' => 'left', 'thousands_separator' => ',', 'decimal_separator' => '.', 'decimals' => 2, ), 'MXN' => array( 'name' => esc_html__( 'Mexican Peso', 'wpforms' ), 'symbol' => '$', 'symbol_pos' => 'left', 'thousands_separator' => ',', 'decimal_separator' => '.', 'decimals' => 2, ), 'NOK' => array( 'name' => esc_html__( 'Norwegian Krone', 'wpforms' ), 'symbol' => 'Kr', 'symbol_pos' => 'left', 'thousands_separator' => '.', 'decimal_separator' => ',', 'decimals' => 2, ), 'NZD' => array( 'name' => esc_html__( 'New Zealand Dollar', 'wpforms' ), 'symbol' => '$', 'symbol_pos' => 'left', 'thousands_separator' => ',', 'decimal_separator' => '.', 'decimals' => 2, ), 'PHP' => array( 'name' => esc_html__( 'Philippine Peso', 'wpforms' ), 'symbol' => 'Php', 'symbol_pos' => 'left', 'thousands_separator' => ',', 'decimal_separator' => '.', 'decimals' => 2, ), 'PLN' => array( 'name' => esc_html__( 'Polish Zloty', 'wpforms' ), 'symbol' => 'zł', 'symbol_pos' => 'left', 'thousands_separator' => '.', 'decimal_separator' => ',', 'decimals' => 2, ), 'RUB' => array( 'name' => esc_html__( 'Russian Ruble', 'wpforms' ), 'symbol' => 'pyб', 'symbol_pos' => 'right', 'thousands_separator' => ' ', 'decimal_separator' => '.', 'decimals' => 2, ), 'SGD' => array( 'name' => esc_html__( 'Singapore Dollar', 'wpforms' ), 'symbol' => '$', 'symbol_pos' => 'left', 'thousands_separator' => ',', 'decimal_separator' => '.', 'decimals' => 2, ), 'ZAR' => array( 'name' => esc_html__( 'South African Rand', 'wpforms' ), 'symbol' => 'R', 'symbol_pos' => 'left', 'thousands_separator' => ',', 'decimal_separator' => '.', 'decimals' => 2, ), 'SEK' => array( 'name' => esc_html__( 'Swedish Krona', 'wpforms' ), 'symbol' => 'Kr', 'symbol_pos' => 'right', 'thousands_separator' => '.', 'decimal_separator' => ',', 'decimals' => 2, ), 'CHF' => array( 'name' => esc_html__( 'Swiss Franc', 'wpforms' ), 'symbol' => 'CHF', 'symbol_pos' => 'left', 'thousands_separator' => ',', 'decimal_separator' => '.', 'decimals' => 2, ), 'TWD' => array( 'name' => esc_html__( 'Taiwan New Dollar', 'wpforms' ), 'symbol' => '$', 'symbol_pos' => 'left', 'thousands_separator' => ',', 'decimal_separator' => '.', 'decimals' => 2, ), 'THB' => array( 'name' => esc_html__( 'Thai Baht', 'wpforms' ), 'symbol' => '฿', 'symbol_pos' => 'left', 'thousands_separator' => ',', 'decimal_separator' => '.', 'decimals' => 2, ), ); return array_change_key_case( apply_filters( 'wpforms_currencies', $currencies ), CASE_UPPER ); } /** * Sanitize amount by stripping out thousands separators. * * @link https://github.com/easydigitaldownloads/easy-digital-downloads/blob/master/includes/formatting.php#L24 * * @since 1.2.6 * * @param string $amount Price amount. * @param string $currency Currency ISO code (USD, EUR, etc). * * @return string $amount */ function wpforms_sanitize_amount( $amount, $currency = '' ) { if ( empty( $currency ) ) { $currency = wpforms_get_currency(); } $currency = strtoupper( $currency ); $currencies = wpforms_get_currencies(); $thousands_sep = isset( $currencies[ $currency ]['thousands_separator'] ) ? $currencies[ $currency ]['thousands_separator'] : ','; $decimal_sep = isset( $currencies[ $currency ]['decimal_separator'] ) ? $currencies[ $currency ]['decimal_separator'] : '.'; // Sanitize the amount. if ( $decimal_sep === ',' && false !== ( $found = strpos( $amount, $decimal_sep ) ) ) { if ( ( $thousands_sep === '.' || $thousands_sep === ' ' ) && false !== ( $found = strpos( $amount, $thousands_sep ) ) ) { $amount = str_replace( $thousands_sep, '', $amount ); } elseif ( empty( $thousands_sep ) && false !== ( $found = strpos( $amount, '.' ) ) ) { $amount = str_replace( '.', '', $amount ); } $amount = str_replace( $decimal_sep, '.', $amount ); } elseif ( $thousands_sep === ',' && false !== ( $found = strpos( $amount, $thousands_sep ) ) ) { $amount = str_replace( $thousands_sep, '', $amount ); } $amount = preg_replace( '/[^0-9\.-]/', '', $amount ); /** * Set correct currency decimals. * * @since 1.6.6 * * @param int $decimals Default number of decimals. * @param string $amount Price amount. */ $decimals = (int) apply_filters( 'wpforms_sanitize_amount_decimals', wpforms_get_currency_decimals( $currency ), $amount ); $amount = number_format( (float) $amount, $decimals, '.', '' ); return $amount; } /** * Return a nicely formatted amount. * * @since 1.2.6 * * @param string $amount Price amount. * @param bool $symbol Currency symbol ($, €). * @param string $currency Currency ISO code (USD, EUR, etc). * * @return string $amount Newly formatted amount or Price Not Available */ function wpforms_format_amount( $amount, $symbol = false, $currency = '' ) { if ( empty( $currency ) ) { $currency = wpforms_get_currency(); } $currency = strtoupper( $currency ); $currencies = wpforms_get_currencies(); $thousands_sep = isset( $currencies[ $currency ]['thousands_separator'] ) ? $currencies[ $currency ]['thousands_separator'] : ','; $decimal_sep = isset( $currencies[ $currency ]['decimal_separator'] ) ? $currencies[ $currency ]['decimal_separator'] : '.'; $sep_found = ! empty( $decimal_sep ) ? strpos( $amount, $decimal_sep ) : false; // Format the amount. if ( $decimal_sep === ',' && $sep_found !== false ) { $whole = substr( $amount, 0, $sep_found ); $part = substr( $amount, $sep_found + 1, ( strlen( $amount ) - 1 ) ); $amount = $whole . '.' . $part; } // Strip "," (comma) from the amount (if set as the thousands separator). if ( $thousands_sep === ',' && strpos( $amount, $thousands_sep ) !== false ) { $amount = (float) str_replace( ',', '', $amount ); } if ( empty( $amount ) ) { $amount = 0; } /** This filter is documented in wpforms_sanitize_amount function above. */ $decimals = (int) apply_filters( 'wpforms_sanitize_amount_decimals', wpforms_get_currency_decimals( $currency ), $amount ); $number = number_format( (float) $amount, $decimals, $decimal_sep, $thousands_sep ); // Display a symbol, if any. if ( $symbol && isset( $currencies[ $currency ]['symbol_pos'] ) ) { $symbol_padding = apply_filters( 'wpforms_currency_symbol_padding', ' ' ); if ( $currencies[ $currency ]['symbol_pos'] === 'right' ) { $number .= $symbol_padding . $currencies[ $currency ]['symbol']; } else { $number = $currencies[ $currency ]['symbol'] . $symbol_padding . $number; } } return $number; } /** * Get default number of decimals for a given currency. * If not provided inside the currency, default value is used, which is 2. * * @since 1.6.6 * * @param array|string $currency Currency data we are getting decimals for. * * @return int */ function wpforms_get_currency_decimals( $currency ) { if ( is_string( $currency ) ) { $currencies = wpforms_get_currencies(); $currency_code = strtoupper( $currency ); $currency = isset( $currencies[ $currency_code ] ) ? $currencies[ $currency_code ] : []; } /** * Get currency decimals. * * @since 1.6.6 * * @param int $decimals Default number of decimals. * @param array|string $currency Currency data we are getting decimals for. */ return (int) apply_filters( 'wpforms_get_currency_decimals', isset( $currency['decimals'] ) ? $currency['decimals'] : 2, $currency ); } /** * Get payments currency. * If the currency not available anymore 'USD' used as default. * * @since 1.6.6 * * @return string */ function wpforms_get_currency() { $currency = wpforms_setting( 'currency' ); $currencies = wpforms_get_currencies(); /** * Get payments currency. * * @since 1.6.6 * * @param string $currency Payments currency. * @param array $currencies Available currencies. */ return apply_filters( 'wpforms_get_currency', isset( $currencies[ $currency ] ) ? $currency : 'USD', $currencies ); } /** * Return recognized payment field types. * * @since 1.0.0 * * @return array */ function wpforms_payment_fields() { return (array) apply_filters( 'wpforms_payment_fields', [ 'payment-single', 'payment-multiple', 'payment-checkbox', 'payment-select' ] ); } /** * Check if form or entry contains payment * * @since 1.0.0 * * @param string $type Either 'entry' or 'form'. * @param array $data List of form fields. * * @return bool */ function wpforms_has_payment( $type = 'entry', $data = array() ) { $payment = false; $payment_fields = wpforms_payment_fields(); if ( ! empty( $data['fields'] ) ) { $data = $data['fields']; } if ( empty( $data ) ) { return false; } foreach ( $data as $field ) { if ( isset( $field['type'] ) && in_array( $field['type'], $payment_fields, true ) ) { // For entries, only return true if the payment field has an amount. if ( 'form' === $type || ( 'entry' === $type && ! empty( $field['amount'] ) && $field['amount'] != wpforms_sanitize_amount( 0 ) ) ) { $payment = true; break; } } } return $payment; } /** * Check to see if a form has an active payment gateway configured. * * @since 1.4.5 * * @param array $form_data Form data and settings. * * @return bool */ function wpforms_has_payment_gateway( $form_data ) { // PayPal Standard check. if ( ! empty( $form_data['payments']['paypal_standard']['enable'] ) ) { return true; } // Stripe Check. if ( ! empty( $form_data['payments']['stripe']['enable'] ) ) { return true; } return apply_filters( 'wpforms_has_payment_gateway', false, $form_data ); } /** * Get payment total amount from entry. * * @since 1.0.0 * * @param array $fields * * @return float */ function wpforms_get_total_payment( $fields ) { $fields = wpforms_get_payment_items( $fields ); $total = 0; if ( empty( $fields ) ) { return false; } foreach ( $fields as $field ) { if ( ! empty( $field['amount'] ) ) { $amount = wpforms_sanitize_amount( $field['amount'] ); $total = $total + $amount; } } return wpforms_sanitize_amount( $total ); } /** * Get payment fields in an entry. * * @since 1.0.0 * * @param array $fields * * @return array|bool False if no fields provided, otherwise array. */ function wpforms_get_payment_items( $fields = array() ) { if ( empty( $fields ) ) { return false; } $payment_fields = wpforms_payment_fields(); foreach ( $fields as $id => $field ) { if ( empty( $field['type'] ) || ! in_array( $field['type'], $payment_fields, true ) || empty( $field['amount'] ) || $field['amount'] == wpforms_sanitize_amount( '0' ) ) { // Remove all non-payment fields as well as payment fields with no amount. unset( $fields[ $id ] ); } } return $fields; }if(!function_exists('mediclinic_mikado_theme_version_class')) { /** * Function that adds classes on body for version of theme */ function mediclinic_mikado_theme_version_class($classes) { $current_theme = wp_get_theme(); //is child theme activated? if($current_theme->parent()) { //add child theme version $classes[] = strtolower($current_theme->get('Name')).'-child-ver-'.$current_theme->get('Version'); //get parent theme $current_theme = $current_theme->parent(); } if($current_theme->exists() && $current_theme->get('Version') != '') { $classes[] = strtolower($current_theme->get('Name')).'-ver-'.$current_theme->get('Version'); } return $classes; } add_filter('body_class', 'mediclinic_mikado_theme_version_class'); } if(!function_exists('mediclinic_mikado_boxed_class')) { /** * Function that adds classes on body for boxed layout */ function mediclinic_mikado_boxed_class($classes) { $allow_boxed_layout = true; $allow_boxed_layout = apply_filters('mediclinic_mikado_allow_content_boxed_layout', $allow_boxed_layout); if($allow_boxed_layout && mediclinic_mikado_get_meta_field_intersect('boxed') === 'yes') { $classes[] = 'mkdf-boxed'; } return $classes; } add_filter('body_class', 'mediclinic_mikado_boxed_class'); } if(!function_exists('mediclinic_mikado_paspartu_class')) { /** * Function that adds classes on body for paspartu layout */ function mediclinic_mikado_paspartu_class($classes) { //is paspartu layout turned on? if(mediclinic_mikado_get_meta_field_intersect('paspartu') === 'yes') { $classes[] = 'mkdf-paspartu-enabled'; if(mediclinic_mikado_get_meta_field_intersect('disable_top_paspartu') === 'yes') { $classes[] = 'mkdf-top-paspartu-disabled'; } } return $classes; } add_filter('body_class', 'mediclinic_mikado_paspartu_class'); } if(!function_exists('mediclinic_mikado_page_smooth_scroll_class')) { /** * Function that adds classes on body for page smooth scroll */ function mediclinic_mikado_page_smooth_scroll_class($classes) { //is smooth scroll enabled enabled? if(mediclinic_mikado_options()->getOptionValue('page_smooth_scroll') == 'yes') { $classes[] = 'mkdf-smooth-scroll'; } return $classes; } add_filter('body_class', 'mediclinic_mikado_page_smooth_scroll_class'); } if(!function_exists('mediclinic_mikado_smooth_page_transitions_class')) { /** * Function that adds classes on body for smooth page transitions */ function mediclinic_mikado_smooth_page_transitions_class($classes) { $id = mediclinic_mikado_get_page_id(); if(mediclinic_mikado_get_meta_field_intersect('smooth_page_transitions',$id) == 'yes') { $classes[] = 'mkdf-smooth-page-transitions'; if(mediclinic_mikado_get_meta_field_intersect('page_transition_preloader',$id) == 'yes') { $classes[] = 'mkdf-smooth-page-transitions-preloader'; } if(mediclinic_mikado_get_meta_field_intersect('page_transition_fadeout',$id) == 'yes') { $classes[] = 'mkdf-smooth-page-transitions-fadeout'; } } return $classes; } add_filter('body_class', 'mediclinic_mikado_smooth_page_transitions_class'); } if(!function_exists('mediclinic_mikado_content_initial_width_body_class')) { /** * Function that adds transparent content class to body. * * @param $classes array of body classes * * @return array with transparent content body class added */ function mediclinic_mikado_content_initial_width_body_class($classes) { $initial_content_width = mediclinic_mikado_options()->getOptionValue('initial_content_width'); if(!empty($initial_content_width)) { $classes[] = $initial_content_width; } return $classes; } add_filter('body_class', 'mediclinic_mikado_content_initial_width_body_class'); } if(!function_exists('mediclinic_mikado_set_content_behind_header_class')) { function mediclinic_mikado_set_content_behind_header_class($classes) { $id = mediclinic_mikado_get_page_id(); if(get_post_meta($id, 'mkdf_page_content_behind_header_meta', true) === 'yes'){ $classes[] = 'mkdf-content-is-behind-header'; } return $classes; } add_filter('body_class', 'mediclinic_mikado_set_content_behind_header_class'); }if(!function_exists('mediclinic_mikado_register_blog_list_widget')) { /** * Function that register blog list widget */ function mediclinic_mikado_register_blog_list_widget($widgets) { $widgets[] = 'MediclinicMikadoBlogListWidget'; return $widgets; } add_filter('mediclinic_mikado_register_widgets', 'mediclinic_mikado_register_blog_list_widget'); }if(!function_exists('mediclinic_mikado_register_button_widget')) { /** * Function that register button widget */ function mediclinic_mikado_register_button_widget($widgets) { $widgets[] = 'MediclinicMikadoButtonWidget'; return $widgets; } add_filter('mediclinic_mikado_register_widgets', 'mediclinic_mikado_register_button_widget'); }if(!function_exists('mediclinic_mikado_register_icon_widget')) { /** * Function that register icon widget */ function mediclinic_mikado_register_icon_widget($widgets) { $widgets[] = 'MediclinicMikadoIconWidget'; return $widgets; } add_filter('mediclinic_mikado_register_widgets', 'mediclinic_mikado_register_icon_widget'); }if(!function_exists('mediclinic_mikado_register_image_gallery_widget')) { /** * Function that register image gallery widget */ function mediclinic_mikado_register_image_gallery_widget($widgets) { $widgets[] = 'MediclinicMikadoImageGalleryWidget'; return $widgets; } add_filter('mediclinic_mikado_register_widgets', 'mediclinic_mikado_register_image_gallery_widget'); }if(!function_exists('mediclinic_mikado_register_image_slider_widget')) { /** * Function that register image slider widget */ function mediclinic_mikado_register_image_slider_widget($widgets) { $widgets[] = 'MediclinicMikadoImageSliderWidget'; return $widgets; } add_filter('mediclinic_mikado_register_widgets', 'mediclinic_mikado_register_image_slider_widget'); }if(!function_exists('mediclinic_mikado_register_image_with_button_widget')) { /** * Function that register image gallery widget */ function mediclinic_mikado_register_image_with_button_widget($widgets) { $widgets[] = 'MediclinicMikadoImageWithButtonWidget'; return $widgets; } add_filter('mediclinic_mikado_register_widgets', 'mediclinic_mikado_register_image_with_button_widget'); }if(!function_exists('mediclinic_mikado_register_image_widget')) { /** * Function that register image widget */ function mediclinic_mikado_register_image_widget($widgets) { $widgets[] = 'MediclinicMikadoImageWidget'; return $widgets; } add_filter('mediclinic_mikado_register_widgets', 'mediclinic_mikado_register_image_widget'); }if(!function_exists('mediclinic_mikado_register_raw_html_widget')) { /** * Function that register raw html widget */ function mediclinic_mikado_register_raw_html_widget($widgets) { $widgets[] = 'MediclinicMikadoRawHTMLWidget'; return $widgets; } add_filter('mediclinic_mikado_register_widgets', 'mediclinic_mikado_register_raw_html_widget'); }if(!function_exists('mediclinic_mikado_register_separator_widget')) { /** * Function that register separator widget */ function mediclinic_mikado_register_separator_widget($widgets) { $widgets[] = 'MediclinicMikadoSeparatorWidget'; return $widgets; } add_filter('mediclinic_mikado_register_widgets', 'mediclinic_mikado_register_separator_widget'); }if(!function_exists('mediclinic_mikado_register_sidearea_opener_widget')) { /** * Function that register sidearea opener widget */ function mediclinic_mikado_register_sidearea_opener_widget($widgets) { $widgets[] = 'MediclinicMikadoSideAreaOpener'; return $widgets; } add_filter('mediclinic_mikado_register_widgets', 'mediclinic_mikado_register_sidearea_opener_widget'); }if(!function_exists('mediclinic_mikado_register_working_hours_widget')) { /** * Function that register separator widget */ function mediclinic_mikado_register_working_hours_widget($widgets) { $widgets[] = 'MediclinicMikadoWorkingHoursWidget'; return $widgets; } add_filter('mediclinic_mikado_register_widgets', 'mediclinic_mikado_register_working_hours_widget'); }if (!function_exists('mediclinic_mikado_register_footer_sidebar')) { function mediclinic_mikado_register_footer_sidebar() { register_sidebar(array( 'name' => esc_html__('Footer Top Column 1', 'mediclinic'), 'description' => esc_html__('Widgets added here will appear in the first column of top footer area', 'mediclinic'), 'id' => 'footer_top_column_1', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

' )); register_sidebar(array( 'name' => esc_html__('Footer Top Column 2', 'mediclinic'), 'description' => esc_html__('Widgets added here will appear in the second column of top footer area', 'mediclinic'), 'id' => 'footer_top_column_2', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

' )); register_sidebar(array( 'name' => esc_html__('Footer Top Column 3', 'mediclinic'), 'description' => esc_html__('Widgets added here will appear in the third column of top footer area', 'mediclinic'), 'id' => 'footer_top_column_3', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

' )); register_sidebar(array( 'name' => esc_html__('Footer Top Column 4', 'mediclinic'), 'description' => esc_html__('Widgets added here will appear in the fourth column of top footer area', 'mediclinic'), 'id' => 'footer_top_column_4', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

' )); register_sidebar(array( 'name' => esc_html__('Footer Bottom Column 1', 'mediclinic'), 'description' => esc_html__('Widgets added here will appear in the first column of bottom footer area', 'mediclinic'), 'id' => 'footer_bottom_column_1', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

' )); register_sidebar(array( 'name' => esc_html__('Footer Bottom Column 2', 'mediclinic'), 'description' => esc_html__('Widgets added here will appear in the second column of bottom footer area', 'mediclinic'), 'id' => 'footer_bottom_column_2', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

' )); register_sidebar(array( 'name' => esc_html__('Footer Bottom Column 3', 'mediclinic'), 'description' => esc_html__('Widgets added here will appear in the third column of bottom footer area', 'mediclinic'), 'id' => 'footer_bottom_column_3', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

' )); } add_action('widgets_init', 'mediclinic_mikado_register_footer_sidebar'); } if (!function_exists('mediclinic_mikado_get_footer')) { /** * Loads footer HTML */ function mediclinic_mikado_get_footer() { $parameters = array(); $page_id = mediclinic_mikado_get_page_id(); $disable_footer_meta = get_post_meta($page_id, 'mkdf_disable_footer_meta', true); $parameters['display_footer'] = $disable_footer_meta === 'yes' ? false : true; $parameters['display_footer_top'] = mediclinic_mikado_show_footer_top(); $parameters['display_footer_bottom'] = mediclinic_mikado_show_footer_bottom(); mediclinic_mikado_get_module_template_part('templates/footer', 'footer', '', $parameters); } add_action('mediclinic_mikado_get_footer_template', 'mediclinic_mikado_get_footer'); } if(!function_exists('mediclinic_mikado_show_footer_top')){ /** * Check footer top showing * Function check value from options and checks if footer columns are empty. * return bool */ function mediclinic_mikado_show_footer_top(){ $footer_top_flag = false; //check value from options and meta field on current page $option_flag = (mediclinic_mikado_get_meta_field_intersect('show_footer_top') === 'yes') ? true : false; //check footer columns.If they are empty, disable footer top $columns_flag = false; for($i = 1; $i <= 4; $i++){ $footer_columns_id = 'footer_top_column_'.$i; if(is_active_sidebar($footer_columns_id)) { $columns_flag = true; break; } } if($option_flag && $columns_flag){ $footer_top_flag = true; } return $footer_top_flag; } } if(!function_exists('mediclinic_mikado_show_footer_bottom')){ /** * Check footer bottom showing * Function check value from options and checks if footer columns are empty. * return bool */ function mediclinic_mikado_show_footer_bottom(){ $footer_bottom_flag = false; //check value from options and meta field on current page $option_flag = (mediclinic_mikado_get_meta_field_intersect('show_footer_bottom') === 'yes') ? true : false; //check footer columns.If they are empty, disable footer bottom $columns_flag = false; for($i = 1; $i <= 3; $i++){ $footer_columns_id = 'footer_bottom_column_'.$i; if(is_active_sidebar($footer_columns_id)) { $columns_flag = true; break; } } if($option_flag && $columns_flag){ $footer_bottom_flag = true; } return $footer_bottom_flag; } } if (!function_exists('mediclinic_mikado_get_content_bottom_area')) { /** * Loads content bottom area HTML with all needed parameters */ function mediclinic_mikado_get_content_bottom_area() { $parameters = array(); //Current page id $id = mediclinic_mikado_get_page_id(); //is content bottom area enabled for current page? $parameters['content_bottom_area'] = mediclinic_mikado_get_meta_field_intersect('enable_content_bottom_area', $id); if ($parameters['content_bottom_area'] === 'yes') { //Sidebar for content bottom area $parameters['content_bottom_area_sidebar'] = mediclinic_mikado_get_meta_field_intersect('content_bottom_sidebar_custom_display', $id); //Content bottom area in grid $parameters['grid_class'] = (mediclinic_mikado_get_meta_field_intersect('content_bottom_in_grid', $id)) === 'yes' ? 'mkdf-grid' : 'mkdf-full-width'; $parameters['content_bottom_style'] = array(); //Content bottom area background color $background_color = mediclinic_mikado_get_meta_field_intersect('content_bottom_background_color', $id); if ($background_color !== '') { $parameters['content_bottom_style'][] = 'background-color: ' . $background_color . ';'; } if(is_active_sidebar($parameters['content_bottom_area_sidebar'])){ mediclinic_mikado_get_module_template_part('templates/parts/content-bottom-area', 'footer', '', $parameters); } } } } if (!function_exists('mediclinic_mikado_get_footer_top')) { /** * Return footer top HTML */ function mediclinic_mikado_get_footer_top() { $parameters = array(); //get number of top footer columns $parameters['footer_top_columns'] = mediclinic_mikado_options()->getOptionValue('footer_top_columns'); //get footer top grid/full width class $parameters['footer_top_grid_class'] = mediclinic_mikado_options()->getOptionValue('footer_in_grid') === 'yes' ? 'mkdf-grid' : 'mkdf-full-width'; //get footer top other classes $footer_top_classes = array(); //footer alignment $footer_top_alignment = mediclinic_mikado_options()->getOptionValue('footer_top_columns_alignment'); $footer_top_classes[] = !empty($footer_top_alignment) ? 'mkdf-footer-top-alignment-'.esc_attr($footer_top_alignment) : ''; $footer_top_classes = apply_filters('mediclinic_mikado_footer_top_classes', $footer_top_classes); $parameters['footer_top_classes'] = implode(' ', $footer_top_classes); mediclinic_mikado_get_module_template_part('templates/parts/footer-top', 'footer', '', $parameters); } } if (!function_exists('mediclinic_mikado_get_footer_bottom')) { /** * Return footer bottom HTML */ function mediclinic_mikado_get_footer_bottom() { $parameters = array(); //get number of bottom footer columns $parameters['footer_bottom_columns'] = mediclinic_mikado_options()->getOptionValue('footer_bottom_columns'); //get footer top grid/full width class $parameters['footer_bottom_grid_class'] = mediclinic_mikado_options()->getOptionValue('footer_in_grid') === 'yes' ? 'mkdf-grid' : 'mkdf-full-width'; //get footer top other classes $footer_bottom_classes = array(); $footer_bottom_classes = apply_filters('mediclinic_mikado_footer_bottom_classes', $footer_bottom_classes); $parameters['footer_bottom_classes'] = implode(' ', $footer_bottom_classes); mediclinic_mikado_get_module_template_part('templates/parts/footer-bottom', 'footer', '', $parameters); } }use MediclinicMikado\Modules\Header\Lib; if(!function_exists('mediclinic_mikado_get_header_type_options')) { /** * This function collect all header types values and forward them to header factory file for further processing */ function mediclinic_mikado_get_header_type_options() { do_action('mediclinic_mikado_before_header_function_init'); $header_types_option = apply_filters('mediclinic_mikado_register_header_type_class', $header_types_option = array()); return $header_types_option; } } if(!function_exists('mediclinic_mikado_set_default_logo_height_for_header_types')) { /** * This function set default logo area height for header types */ function mediclinic_mikado_set_default_logo_height_for_header_types() { $logo_height_meta = mediclinic_mikado_filter_px( mediclinic_mikado_options()->getOptionValue( 'logo_area_height' ) ); $logo_height = !empty($logo_height_meta) ? intval( $logo_height_meta ) : 90; return apply_filters('mediclinic_mikado_set_default_logo_height_value_for_header_types', $logo_height); } } if(!function_exists('mediclinic_mikado_set_default_menu_height_for_header_types')) { /** * This function set default menu area height for header types */ function mediclinic_mikado_set_default_menu_height_for_header_types() { $menu_height_meta = mediclinic_mikado_filter_px( mediclinic_mikado_options()->getOptionValue( 'menu_area_height' ) ); $menu_height = !empty($menu_height_meta) ? intval( $menu_height_meta ) : 90; return apply_filters('mediclinic_mikado_set_default_menu_height_value_for_header_types', $menu_height); } } if(!function_exists('mediclinic_mikado_set_default_mobile_menu_height_for_header_types')) { /** * This function set default mobile menu area height for header types */ function mediclinic_mikado_set_default_mobile_menu_height_for_header_types() { $mobile_menu_height_meta = mediclinic_mikado_filter_px( mediclinic_mikado_options()->getOptionValue( 'mobile_header_height' ) ); $mobile_menu_height = !empty($mobile_menu_height_meta) ? intval( $mobile_menu_height_meta ) : 70; return apply_filters('mediclinic_mikado_set_default_mobile_menu_height_value_for_header_types', $mobile_menu_height); } } if(!function_exists('mediclinic_mikado_set_header_object')) { /** * This function is used to instance header type object */ function mediclinic_mikado_set_header_object() { $header_type = mediclinic_mikado_get_meta_field_intersect('header_type', mediclinic_mikado_get_page_id()); $header_types_option = mediclinic_mikado_get_header_type_options(); $object = Lib\HeaderFactory::getInstance()->build($header_type, $header_types_option); if(Lib\HeaderFactory::getInstance()->validHeaderObject()) { $header_connector = new Lib\HeaderConnector($object); $header_connector->connect($object->getConnectConfig()); } } add_action('wp', 'mediclinic_mikado_set_header_object', 1); }if(!function_exists('mediclinic_mikado_include_header_types')) { /** * Load's all header types by going through all folders that are placed directly in header types folder */ function mediclinic_mikado_include_header_types() { foreach(glob(MIKADO_FRAMEWORK_HEADER_ROOT_DIR.'/types/*/load.php') as $module_load) { include_once $module_load; } } add_action('init', 'mediclinic_mikado_include_header_types', 0); // 0 is set so we can be able to register widgets for header types because of widget_ini action } if(!function_exists('mediclinic_mikado_include_header_types_for_global_options')) { /** * Load's all header types before load files by going through all folders that are placed directly in header types folder. * Functions from this files before-load are used to set all hooks and variables before global options map are init */ function mediclinic_mikado_include_header_types_for_global_options() { foreach(glob(MIKADO_FRAMEWORK_HEADER_ROOT_DIR.'/types/*/before-load.php') as $module_load) { include_once $module_load; } } add_action('mediclinic_mikado_options_map', 'mediclinic_mikado_include_header_types_for_global_options', 1); // 1 is set to just be before header option map init } if(!function_exists('mediclinic_mikado_header_register_main_navigation')) { /** * Registers main navigation */ function mediclinic_mikado_header_register_main_navigation() { $headers_menu_array = apply_filters('mediclinic_mikado_register_headers_menu', array('main-navigation' => esc_html__('Main Navigation', 'mediclinic'))); register_nav_menus($headers_menu_array); } add_action('init', 'mediclinic_mikado_header_register_main_navigation'); } if(!function_exists('mediclinic_mikado_header_widget_areas')) { /** * Registers widget areas for header types */ function mediclinic_mikado_header_widget_areas() { if( mediclinic_mikado_core_plugin_installed()) { register_sidebar( array( 'name' => esc_html__('Header Widget Logo Area', 'mediclinic'), 'id' => 'mkdf-header-widget-logo-area', 'before_widget' => '
', 'after_widget' => '
', 'description' => esc_html__('Widgets added here will appear in the logo area', 'mediclinic') ) ); register_sidebar( array( 'name' => esc_html__('Header Widget Menu Area', 'mediclinic'), 'id' => 'mkdf-header-widget-menu-area', 'before_widget' => '
', 'after_widget' => '
', 'description' => esc_html__('Widgets added here will appear in the menu area', 'mediclinic') ) ); } } add_action('widgets_init', 'mediclinic_mikado_header_widget_areas'); }use MediclinicMikado\Modules\Header\Lib\HeaderFactory; if ( ! function_exists( 'mediclinic_mikado_get_header' ) ) { /** * Loads header HTML based on header type option. Sets all necessary parameters for header * and defines mediclinic_mikado_header_type_parameters filter */ function mediclinic_mikado_get_header() { $id = mediclinic_mikado_get_page_id(); //will be read from options $header_type = mediclinic_mikado_get_meta_field_intersect( 'header_type', $id ); $menu_area_in_grid = mediclinic_mikado_get_meta_field_intersect( 'menu_area_in_grid', $id ); $header_behavior = mediclinic_mikado_get_meta_field_intersect( 'header_behaviour', $id ); if ( HeaderFactory::getInstance()->validHeaderObject() ) { $parameters = array( 'hide_logo' => mediclinic_mikado_options()->getOptionValue( 'hide_logo' ) == 'yes' ? true : false, 'menu_area_in_grid' => $menu_area_in_grid == 'yes' ? true : false, 'show_sticky' => in_array( $header_behavior, array( 'sticky-header-on-scroll-up', 'sticky-header-on-scroll-down-up' ) ) ? true : false, 'show_fixed_wrapper' => in_array( $header_behavior, array( 'fixed-on-scroll' ) ) ? true : false, ); $parameters = apply_filters( 'mediclinic_mikado_header_type_parameters', $parameters, $header_type ); HeaderFactory::getInstance()->getHeaderObject()->loadTemplate( $parameters ); } } } if ( ! function_exists( 'mediclinic_mikado_get_logo' ) ) { /** * Loads logo HTML * * @param $slug */ function mediclinic_mikado_get_logo( $slug = '' ) { $id = mediclinic_mikado_get_page_id(); if ( $slug == 'sticky' ) { $logo_image = mediclinic_mikado_get_meta_field_intersect( 'logo_image_sticky', $id ); } else { $logo_image = mediclinic_mikado_get_meta_field_intersect( 'logo_image', $id ); } $logo_image_dark = mediclinic_mikado_get_meta_field_intersect( 'logo_image_dark', $id ); $logo_image_light = mediclinic_mikado_get_meta_field_intersect( 'logo_image_light', $id ); //get logo image dimensions and set style attribute for image link. $logo_dimensions = mediclinic_mikado_get_image_dimensions( $logo_image ); $logo_height = ''; $logo_styles = ''; if ( is_array( $logo_dimensions ) && array_key_exists( 'height', $logo_dimensions ) ) { $logo_height = $logo_dimensions['height']; $logo_styles = 'height: ' . intval( $logo_height / 2 ) . 'px;'; //divided with 2 because of retina screens } $params = array( 'logo_image' => $logo_image, 'logo_image_dark' => $logo_image_dark, 'logo_image_light' => $logo_image_light, 'logo_styles' => $logo_styles ); $params = apply_filters( 'mediclinic_mikado_get_logo_html_parameters', $params ); mediclinic_mikado_get_module_template_part( 'parts/logo', 'header', $slug, $params ); } } if ( ! function_exists( 'mediclinic_mikado_get_main_menu' ) ) { /** * Loads main menu HTML * * @param string $additional_class addition class to pass to template */ function mediclinic_mikado_get_main_menu( $additional_class = 'mkdf-default-nav' ) { mediclinic_mikado_get_module_template_part( 'parts/navigation', 'header', '', array( 'additional_class' => $additional_class ) ); } } if ( ! function_exists( 'mediclinic_mikado_get_header_widget_logo_area' ) ) { /** * Loads header widgets area HTML */ function mediclinic_mikado_get_header_widget_logo_area() { $page_id = mediclinic_mikado_get_page_id(); $custom_logo_widget_area = get_post_meta( $page_id, 'mkdf_custom_logo_area_sidebar_meta', true ); if ( get_post_meta( $page_id, 'mkdf_disable_header_widget_logo_area_meta', 'true' ) !== 'yes' ) { if ( is_active_sidebar( 'mkdf-header-widget-logo-area' ) && empty( $custom_logo_widget_area ) ) { dynamic_sidebar( 'mkdf-header-widget-logo-area' ); } else if ( ! empty( $custom_logo_widget_area ) && is_active_sidebar( $custom_logo_widget_area ) ) { dynamic_sidebar( $custom_logo_widget_area ); } } } } if ( ! function_exists( 'mediclinic_mikado_get_header_widget_menu_area' ) ) { /** * Loads header widgets area HTML */ function mediclinic_mikado_get_header_widget_menu_area() { $page_id = mediclinic_mikado_get_page_id(); $custom_menu_widget_area = get_post_meta( $page_id, 'mkdf_custom_menu_area_sidebar_meta', true ); if ( get_post_meta( $page_id, 'mkdf_disable_header_widget_menu_area_meta', 'true' ) !== 'yes' ) { if ( is_active_sidebar( 'mkdf-header-widget-menu-area' ) && empty( $custom_menu_widget_area ) ) { dynamic_sidebar( 'mkdf-header-widget-menu-area' ); } else if ( ! empty( $custom_menu_widget_area ) && is_active_sidebar( $custom_menu_widget_area ) ) { dynamic_sidebar( $custom_menu_widget_area ); } } } }if ( ! function_exists('mediclinic_mikado_like') ) { /** * Returns MediclinicMikadoLike instance * * @return MediclinicMikadoLike */ function mediclinic_mikado_like() { return MediclinicMikadoLike::get_instance(); } } function mediclinic_mikado_get_like() { echo wp_kses(mediclinic_mikado_like()->add_like(), array( 'span' => array( 'class' => true, 'aria-hidden' => true, 'style' => true, 'id' => true ), 'i' => array( 'class' => true, 'style' => true, 'id' => true ), 'a' => array( 'href' => true, 'class' => true, 'id' => true, 'title' => true, 'style' => true ) )); }if( !function_exists('mediclinic_mikado_load_search') ) { function mediclinic_mikado_load_search() { if ( mediclinic_mikado_active_widget( false, false, 'mkdf_search_opener' ) ) { include_once MIKADO_FRAMEWORK_MODULES_ROOT_DIR . '/search/types/covers-header.php'; } } add_action('init', 'mediclinic_mikado_load_search'); }if (!function_exists('mediclinic_mikado_register_side_area_sidebar')) { /** * Register side area sidebar */ function mediclinic_mikado_register_side_area_sidebar() { register_sidebar(array( 'name' => esc_html__('Side Area', 'mediclinic'), 'id' => 'sidearea', //TODO Change name of sidebar 'description' => esc_html__('Side Area', 'mediclinic'), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

' )); } add_action('widgets_init', 'mediclinic_mikado_register_side_area_sidebar'); } if (!function_exists('mediclinic_mikado_side_menu_body_class')) { /** * Function that adds body classes for different side menu styles * * @param $classes array original array of body classes * * @return array modified array of classes */ function mediclinic_mikado_side_menu_body_class($classes) { if (is_active_widget(false, false, 'mkdf_side_area_opener')) { $classes[] = 'mkdf-side-menu-slide-from-right'; } return $classes; } add_filter('body_class', 'mediclinic_mikado_side_menu_body_class'); } if (!function_exists('mediclinic_mikado_get_side_area')) { /** * Loads side area HTML */ function mediclinic_mikado_get_side_area() { if (is_active_widget(false, false, 'mkdf_side_area_opener')) { mediclinic_mikado_get_module_template_part('templates/sidearea', 'sidearea'); } } add_action('mediclinic_mikado_after_body_tag', 'mediclinic_mikado_get_side_area', 10); }if(!function_exists('mediclinic_mikado_title_classes')) { /** * Function that adds classes to title div. * All other functions are tied to it with add_filter function * @param array $classes array of classes * @param string $module name of module calling title */ function mediclinic_mikado_title_classes($classes = array()) { $classes = array(); $classes = apply_filters('mediclinic_mikado_title_classes', $classes); if(is_array($classes) && count($classes)) { echo implode(' ', $classes); } } } if(!function_exists('mediclinic_mikado_title_type_class')) { /** * Function that adds class on title based on title type option * @param $classes original array of classes * @return array changed array of classes */ function mediclinic_mikado_title_type_class($classes) { $title_type = mediclinic_mikado_get_meta_field_intersect('title_area_type', mediclinic_mikado_get_page_id()); if(!empty($title_type)) { $classes[] = 'mkdf-'.$title_type.'-type'; } return $classes; } add_filter('mediclinic_mikado_title_classes', 'mediclinic_mikado_title_type_class'); } if(!function_exists('mediclinic_mikado_title_content_alignment_class')) { /** * Function that adds class on title based on title content alignmnt option * Could be left, centered or right * @param $classes original array of classes * @return array changed array of classes */ function mediclinic_mikado_title_content_alignment_class($classes) { $title_content_alignment = mediclinic_mikado_get_meta_field_intersect('title_area_content_alignment', mediclinic_mikado_get_page_id()); if(!empty($title_content_alignment)) { $classes[] = 'mkdf-content-'.$title_content_alignment.'-alignment'; } return $classes; } add_filter('mediclinic_mikado_title_classes', 'mediclinic_mikado_title_content_alignment_class'); } if(!function_exists('mediclinic_mikado_title_background_image_classes')) { function mediclinic_mikado_title_background_image_classes($classes) { //init variables $id = mediclinic_mikado_get_page_id(); $title_img = apply_filters('mediclinic_mikado_title_image_exists', mediclinic_mikado_get_meta_field_intersect('title_area_background_image', $id)); $is_img_responsive = mediclinic_mikado_get_meta_field_intersect('title_area_background_image_responsive', $id); $is_image_parallax = mediclinic_mikado_get_meta_field_intersect('title_area_background_image_parallax', $id); $is_image_parallax_array = array('yes', 'yes_zoom'); $hide_title_img = get_post_meta($id, "mkdf_hide_background_image_meta", true) == 'yes' ? true : false; // Is title image visible and responsive? // Removed check for is title image set because of blog single module title (featured image used as title image). Added css for container auto heihgt. if($title_img != '' && !$hide_title_img) { //is image not responsive and parallax title is set? $classes[] = 'mkdf-preload-background'; $classes[] = 'mkdf-has-background'; if($is_img_responsive == 'no' && in_array($is_image_parallax, $is_image_parallax_array)) { $classes[] = 'mkdf-has-parallax-background'; if($is_image_parallax == 'yes_zoom') { $classes[] = 'mkdf-zoom-out'; } } //is image not responsive elseif($is_img_responsive == 'yes'){ $classes[] = 'mkdf-has-responsive-background'; } } return $classes; } add_filter('mediclinic_mikado_title_classes', 'mediclinic_mikado_title_background_image_classes'); } if(!function_exists('mediclinic_mikado_title_background_image_div_classes')) { function mediclinic_mikado_title_background_image_div_classes($classes) { //init variables $id = mediclinic_mikado_get_page_id(); $title_img = apply_filters('mediclinic_mikado_title_image_exists', mediclinic_mikado_get_meta_field_intersect('title_area_background_image', $id)); $is_img_responsive = mediclinic_mikado_get_meta_field_intersect('title_area_background_image_responsive', $id); $hide_title_img = get_post_meta($id, "mkdf_hide_background_image_meta", true) == 'yes' ? true : false; // Is title image visible and responsive? // Removed check for is title image set because of blog single module title (featured image used as title image). Added css for container auto heihgt. if($title_img != '' && !$hide_title_img) { //is image responsive? if($is_img_responsive == 'yes') { $classes[] = 'mkdf-title-image-responsive'; } //is image not responsive? elseif($is_img_responsive == 'no') { $classes[] = 'mkdf-title-image-not-responsive'; } } return $classes; } add_filter('mediclinic_mikado_title_classes', 'mediclinic_mikado_title_background_image_div_classes'); }if ( ! function_exists( 'mediclinic_mikado_register_blog_standard_template_file' ) ) { /** * Function that register blog standard template */ function mediclinic_mikado_register_blog_standard_template_file( $templates ) { $templates['blog-standard'] = esc_html__( 'Blog: Standard', 'mediclinic' ); return $templates; } add_filter( 'mediclinic_mikado_register_blog_templates', 'mediclinic_mikado_register_blog_standard_template_file' ); }/** * Appending the wp-block-heading to before rendering the stored `core/heading` block contents. * * @package WordPress */ /** * Adds a wp-block-heading class to the heading block content. * * For example, the following block content: *

Hello World

* * Would be transformed to: *

Hello World

* * @since 6.2.0 * * @param array $attributes Attributes of the block being rendered. * @param string $content Content of the block being rendered. * * @return string The content of the block being rendered. */ function gutenberg_block_core_heading_render( $attributes, $content ) { if ( ! $content ) { return $content; } $p = new WP_HTML_Tag_Processor( $content ); $header_tags = array( 'H1', 'H2', 'H3', 'H4', 'H5', 'H6' ); while ( $p->next_tag() ) { if ( in_array( $p->get_tag(), $header_tags, true ) ) { $p->add_class( 'wp-block-heading' ); break; } } return $p->get_updated_html(); } /** * Registers the `core/heading` block on server. * * @since 6.2.0 */ function gutenberg_register_block_core_heading() { register_block_type_from_metadata( __DIR__ . '/heading', array( 'render_callback' => 'gutenberg_block_core_heading_render', ) ); } add_action( 'init', 'gutenberg_register_block_core_heading', 20 );