<?php


/**
 * Function to create a breadcrumb for GeoDirectory
 * @deprecated
 */
function geodir_breadcrumb(){
    _deprecated_function( 'geodir_breadcrumb', '2.0.0' );
}

/**
 * Get the post featured image.
 * @deprecated
 */
function geodir_get_featured_image(){
    _deprecated_function( 'geodir_get_featured_image', '2.0.0' );
}

/**
 * Output the post featured image.
 * @deprecated
 */
function geodir_show_featured_image(){
    _deprecated_function( 'geodir_show_featured_image', '2.0.0' );
}

/**
 * Output the post images.
 * @deprecated
 */
function geodir_show_image(){
    _deprecated_function( 'geodir_show_image', '2.0.0' );
}

/**
 * The old way to save post images.
 * @deprecated
 */
function geodir_save_post_images(){
    _deprecated_function( 'geodir_save_post_images', '2.0.0' );
}

// shortcode functions

/**
 * @deprecated
 */
function geodir_sc_home_map(){
    _deprecated_function( 'geodir_sc_home_map', '2.0.0' );
}

/**
 * @deprecated
 */
function geodir_sc_listing_map(){
    _deprecated_function( 'geodir_sc_listing_map', '2.0.0' );
}

/**
 * @deprecated
 */
function geodir_sc_login_box(){
    _deprecated_function( 'geodir_sc_login_box', '2.0.0' );
}

/**
 * @deprecated
 */
function geodir_sc_popular_post_category(){
    _deprecated_function( 'geodir_sc_popular_post_category', '2.0.0' );
}

/**
 * @deprecated
 */
function geodir_sc_popular_post_view(){
    _deprecated_function( 'geodir_sc_popular_post_view', '2.0.0' );
}

/**
 * @deprecated
 */
function geodir_sc_related_listings(){
    _deprecated_function( 'geodir_sc_related_listings', '2.0.0' );
}

/**
 * @deprecated
 */
function geodir_sc_bestof_widget(){
    _deprecated_function( 'geodir_sc_bestof_widget', '2.0.0' );
}

/**
 * @deprecated
 */
function geodir_sc_gd_listings(){
    _deprecated_function( 'geodir_sc_gd_listings', '2.0.0' );
}

/**
 * @deprecated
 */
function geodir_sc_cpt_categories_widget(){
    _deprecated_function( 'geodir_sc_cpt_categories_widget', '2.0.0' );
}

/**
 * @deprecated
 */
function geodir_sc_responsive_videos(){
    _deprecated_function( 'geodir_sc_responsive_videos', '2.0.0' );
}

/**
 * @deprecated
 */
function gdsc_validate_map_args(){
    _deprecated_function( 'gdsc_validate_map_args', '2.0.0' );
}

/**
 * @deprecated
 */
function gdsc_to_bool_val(){
    _deprecated_function( 'gdsc_to_bool_val', '2.0.0' );
}

/**
 * @deprecated
 */
function gdsc_is_post_type_valid(){
    _deprecated_function( 'gdsc_is_post_type_valid', '2.0.0' );
}

/**
 * @deprecated
 */
function gdsc_manage_category_choice(){
    _deprecated_function( 'gdsc_manage_category_choice', '2.0.0' );
}

/**
 * @deprecated
 */
function geodir_home_map_add_script(){
    _deprecated_function( 'geodir_home_map_add_script', '2.0.0' );
}

/**
 * @deprecated
 */
function geodir_popular_post_category_output(){
    _deprecated_function( 'geodir_popular_post_category_output', '2.0.0' );
}

/**
 * @deprecated
 */
function geodir_popular_category_add_scripts(){
    _deprecated_function( 'geodir_popular_category_add_scripts', '2.0.0' );
}

/**
 * @deprecated
 */
function gdsc_validate_layout_choice(){
    _deprecated_function( 'gdsc_validate_layout_choice', '2.0.0' );
}

/**
 * @deprecated
 */
function gdsc_validate_sort_choice(){
    _deprecated_function( 'gdsc_validate_sort_choice', '2.0.0' );
}

/**
 * @deprecated
 */
function gdsc_validate_listing_width(){
    _deprecated_function( 'gdsc_validate_listing_width', '2.0.0' );
}

/**
 * @deprecated
 */
function gdsc_validate_list_filter_choice(){
    _deprecated_function( 'gdsc_validate_list_filter_choice', '2.0.0' );
}

/**
 * @deprecated
 */
function geodir_sc_gd_listings_output(){
    _deprecated_function( 'geodir_sc_gd_listings_output', '2.0.0' );
}

/**
 * @deprecated
 */
function geodir_sc_listings_pagination(){
    _deprecated_function( 'geodir_sc_listings_pagination', '2.0.0' );
}

/**
 * @deprecated
 */
function geodir_sclistings_callback(){
    _deprecated_function( 'geodir_sclistings_callback', '2.0.0' );
}

/**
 * @deprecated
 */
function geodir_sc_single_meta(){
    _deprecated_function( 'geodir_sc_single_meta', '2.0.0' );
}

/**
 * @deprecated
 */
function geodir_bestof_places_by_term(){
    _deprecated_function( 'geodir_bestof_places_by_term', '2.0.0' );
}

/**
 * @deprecated
 */
function geodir_features_parse_image(){
    _deprecated_function( 'geodir_features_parse_image', '2.0.0' );
}

/**
 * @deprecated
 */
function geodir_features_parse_desc(){
    _deprecated_function( 'geodir_features_parse_desc', '2.0.0' );
}
/**
 * @deprecated
 */
function init_listing_map_script(){
    _deprecated_function( 'init_listing_map_script', '2.0.0' );
}
/**
 * @deprecated
 */
function create_list_jsondata(){
    _deprecated_function( 'create_list_jsondata', '2.0.0' );
}
/**
 * @deprecated
 */
function show_listing_widget_map(){
    _deprecated_function( 'show_listing_widget_map', '2.0.0' );
}

/**
 * @deprecated
 */
function geodir_font_awesome_rating_stars_html(){
    _deprecated_function( 'geodir_font_awesome_rating_stars_html', '2.0.0' );
}

/**
 * @deprecated
 */
function geodir_show_listing_post_excerpt(){
    _deprecated_function( 'geodir_show_listing_post_excerpt', '2.0.0' );
}

/**
 * @deprecated
 */
function geodir_pagination(){
    _deprecated_function( 'geodir_pagination', '2.0.0' );
}

/**
 * @deprecated
 */
function is_page_geodir_home(){
    _deprecated_function( 'is_page_geodir_home', '2.0.0' );
}

/**
 * @deprecated
 */
function geodir_get_current_city_lat(){
    _deprecated_function( 'geodir_get_current_city_lat', '2.0.0' );
}

/**
 * @deprecated
 */
function geodir_get_current_city_lng(){
    _deprecated_function( 'geodir_get_current_city_lng', '2.0.0' );
}

/**
 * @deprecated
 */
function geodir_is_default_location_set(){
    _deprecated_function( 'geodir_is_default_location_set', '2.0.0' );
}

/**
 * @deprecated
 */
function geodir_get_default_location(){
    _deprecated_function( 'geodir_get_default_location', '2.0.0' );
}

/**
 * @deprecated
 */
function geodir_get_country_by_name(){
    _deprecated_function( 'geodir_get_country_by_name', '2.0.0' );
}

/**
 * @deprecated
 */
function geodir_get_normal_country(){
    _deprecated_function( 'geodir_get_normal_country', '2.0.0' );
}

/**
 * @deprecated
 */
function create_location_slug( $location_string ) {
	_deprecated_function( 'create_location_slug', '2.0.0', 'geodir_create_location_slug()' );
}

/**
 * Returns package information as an objects.
 *
 * @since   1.0.0
 * @package GeoDirectory
 * @deprecated
 *
 * @param array $package_info Package info array.
 * @param object|string $post The post object.
 * @param string $post_type   The post type.
 *
 * @return object Returns filtered package info as an object.
 */
function geodir_post_package_info( $package_info, $post = '', $post_type = '' ) {
	_deprecated_function( __FUNCTION__, '2.0.0', 'geodir_get_post_package()' );

	return geodir_get_post_package( $post, $post_type );
}

/**
 * @deprecated
 */
function geodir_is_reviews_show(){
    _deprecated_function( 'geodir_is_reviews_show', '2.0.0' );
}

/**
 * @deprecated
 */
function geodir_get_video(){
    _deprecated_function( 'geodir_get_video', '2.0.0' );
}

/**
 * Check wpml active or not.
 * 
 * @deprecated 2.0.0
 */
function geodir_is_wpml() {
	_deprecated_function( __FUNCTION__, '2.0.0' );

	return false;
}


/**
 * @deprecated 2.0.0
 */
function geodir_count_reviews_by_terms($force_update = false, $post_ID = 0 ){
    _deprecated_function( __FUNCTION__, '2.0.0' );
}

/**
 * @deprecated 2.0.0
 */
function geodir_wpml_is_post_type_translated($post_type ){
    _deprecated_function( __FUNCTION__, '2.0.0' );
}

/**
 * @deprecated 2.0.0
 */
function geodir_user_signup(){
    _deprecated_function( __FUNCTION__, '2.0.0' );
}

/**
 * @deprecated 2.0.0
 */
function geodir_load_textdomain(){
    _deprecated_function( __FUNCTION__, '2.0.0' );
}

/**
 * @deprecated 2.0.0
 */
if(!class_exists('Geodir_Session')){
    class Geodir_Session {
        public function get( $key ) {
            return '';
        }
        public function set( $key, $value ) {
            return '';
        }

        public function un_set( $key ) {
            return '';
        }
    }
    global $gd_session;
    $gd_session = new Geodir_Session();
}

/**
 * @deprecated 2.0.0
 */
function geodir_update_options($options, $dummy = false){
    _deprecated_function( __FUNCTION__, '2.0.0' );
}

/**
 * @deprecated 2.0.0
 */
function geodir_resave_settings($settings = array()){
    _deprecated_function( __FUNCTION__, '2.0.0' );
}


if ( defined( 'GEODIRREVIEWRATING_VERSION' ) ) {
/**
 * @deprecated 2.0.0
 */
function geodir_get_commentoverall( $comment_id = 0 ) {
    _deprecated_function( __FUNCTION__, '2.0.0', 'GeoDir_Comments::get_comment_rating()' );

	return false;
}
}

/**
 * @deprecated 2.0.0.97
 */
function geodir_get_addlisting_link( $post_type = '' ) {
	//_deprecated_function( __FUNCTION__, '2.0.0.97', 'geodir_add_listing_page_url()' );

	return geodir_add_listing_page_url( $post_type );
}

/**
 * @deprecated 2.1.0.5
 */
function get_post_type_plural_label( $post_type, $echo = false, $translate = false ) {
	//_deprecated_function( __FUNCTION__, '2.1.0.5', 'geodir_get_post_type_plural_label()' );

	return geodir_get_post_type_plural_label( $post_type, $echo, $translate );
}

/**
 * @deprecated 2.1.0.5
 */
function get_post_type_singular_label( $post_type, $echo = false, $translate = false ) {
	//_deprecated_function( __FUNCTION__, '2.1.0.5', 'geodir_get_post_type_singular_label()' );

	return geodir_get_post_type_singular_label( $post_type, $echo, $translate );
}

/**
 * @deprecated 2.3.62
 */
function geodir_diagnostic_tools_setting_page() {
	_deprecated_function( __FUNCTION__, '2.3.62' );
}

/**
 * @deprecated 2.3.62
 */
function geodir_admin_ajax_handler() {
	_deprecated_function( __FUNCTION__, '2.3.62' );
}

/**
 * @deprecated 2.3.62
 */
function geodir_diagnose_tags_sync() {
	_deprecated_function( __FUNCTION__, '2.3.62' );
}

/**
 * @deprecated 2.3.62
 */
function geodir_diagnose_cats_sync() {
	_deprecated_function( __FUNCTION__, '2.3.62' );
}

/**
 * @deprecated 2.3.62
 */
function geodir_diagnose_version_clear() {
	_deprecated_function( __FUNCTION__, '2.3.62' );
}

/**
 * @deprecated 2.3.62
 */
function geodir_diagnose_ratings() {
	_deprecated_function( __FUNCTION__, '2.3.62' );
}

/**
 * @deprecated 2.3.62
 */
function geodir_diagnose_multisite_conversion() {
	_deprecated_function( __FUNCTION__, '2.3.62' );
}

/**
 * @deprecated 2.3.62
 */
function geodir_fix_virtual_page( $slug, $page_title, $old_id, $option ) {
	_deprecated_function( __FUNCTION__, '2.3.62' );
}

/**
 * @deprecated 2.3.62
 */
function geodir_diagnose_default_pages() {
	_deprecated_function( __FUNCTION__, '2.3.62' );
}

/**
 * @deprecated 2.3.62
 */
function geodir_diagnose_load_db_language() {
	_deprecated_function( __FUNCTION__, '2.3.62' );
}

/**
 * @deprecated 2.3.62
 */
function geodir_posts_clauses_request( $clauses ) {
	_deprecated_function( __FUNCTION__, '2.3.62' );
	return $clauses;
}

//
///**
// * @deprecated
// */
//function (){
//    _deprecated_function( '', '2.0.0' );
//}

/**
 * Fix icons broken by FontAwesome v6.5.0.
 *
 * Download link is broken for FontAwesome v6.5.0.
 * @see https://github.com/FortAwesome/Font-Awesome/issues/20018
 *
 * @todo Remove once downland link fixed by FontAwesome.
 */
function geodir_fa_6_5_0_fix_get_option( $value, $option ) {
	if ( ! ( $option == 'wp-font-awesome-settings' && ! empty( $value ) && is_array( $value ) ) ) {
		return $value;
	}

	if ( ! ( ! empty( $value['version'] ) && version_compare( $value['version'], '6.5.0', '<' ) ) ) {
		$value['version'] = '6.4.2';
	}

	return $value;
}
//add_filter( 'option_wp-font-awesome-settings', 'geodir_fa_6_5_0_fix_get_option', 21, 2 );

function geodir_fa_6_5_0_fix_update_option( $value, $old_value, $option ) {
	if ( ! ( $option == 'wp-font-awesome-settings' && ! empty( $value ) && is_array( $value ) ) ) {
		return $value;
	}

	if ( empty( $value['version'] ) ) {
		return $value;
	}

	if ( ! version_compare( $value['version'], '6.5.0', '<' ) ) {
		$value['version'] = '';
	}

	return $value;
}
//add_filter( 'pre_update_option_wp-font-awesome-settings', 'geodir_fa_6_5_0_fix_update_option', 21, 3 );