$field_value ) { if ( $field_name === 'social_repeater' ) { $social_repeater_value = json_decode( $field_value ); if ( ! empty( $social_repeater_value ) ) { foreach ( $social_repeater_value as $social ) { foreach ( $social as $key => $value ) { if ( $key === 'link' ) { pll_register_string( 'Social link', $value, $name ); } if ( $key === 'icon' ) { pll_register_string( 'Social icon', $value, $name ); } } } } } else { if ( $field_name !== 'id' && $field_name !== 'choice' ) { $f_n = ucfirst( $field_name ); pll_register_string( $f_n, $field_value, $name ); } } } } } } }// End if(). if ( ! function_exists( 'azera_shop_filter_translations' ) ) { /** * Define Allowed Files to be included. */ function azera_shop_filter_translations( $array ) { return array_merge( $array, array( 'translations/translations-logos-section', 'translations/translations-contact-section', 'translations/translations-shortcode-section', 'translations/translations-footer-socials', ) ); } } add_filter( 'azera_shop_filter_translations', 'azera_shop_filter_translations' ); if ( ! function_exists( 'azera_shop_include_translations' ) ) { /** * Include translations files. */ function azera_shop_include_translations() { $azera_shop_allowed_phps = array(); $azera_shop_allowed_phps = apply_filters( 'azera_shop_filter_translations', $azera_shop_allowed_phps ); foreach ( $azera_shop_allowed_phps as $file ) { $azera_shop_file_to_include = get_template_directory() . '/inc/' . $file . '.php'; if ( file_exists( $azera_shop_file_to_include ) ) { include_once( $azera_shop_file_to_include ); } else { if ( defined( 'AZERA_SHOP_COMPANION_PATH' ) ) { $azera_shop_file_to_include_from_companion = AZERA_SHOP_COMPANION_PATH . '/inc/' . $file . '.php'; if ( file_exists( $azera_shop_file_to_include_from_companion ) ) { include_once( $azera_shop_file_to_include_from_companion ); } } elseif ( defined( 'AZERA_SHOP_PLUS_PATH' ) ) { $azera_shop_file_to_include_from_pro = AZERA_SHOP_PLUS_PATH . 'public/inc/' . $file . '.php'; if ( file_exists( $azera_shop_file_to_include_from_pro ) ) { include_once( $azera_shop_file_to_include_from_pro ); } } } } } } add_action( 'after_setup_theme', 'azera_shop_include_translations' );