From 7f33f609f25586cc2ba145ee16858400cfd666a3 Mon Sep 17 00:00:00 2001 From: EclipseSrl Date: Thu, 10 Dec 2020 12:05:31 +0100 Subject: [PATCH] release 2.0.18 --- README.txt | 7 +++++-- includes/misc/acf.php | 26 ++++++++++++++++++++++++++ udesly-adapter-plugin.php | 4 ++-- 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/README.txt b/README.txt index 9394037..f10df1e 100644 --- a/README.txt +++ b/README.txt @@ -4,10 +4,10 @@ Donate link: https://www.udesly.com/ Tags: webflow to wordpress, editor, page builder, layout design, udesly, webflow Requires at least: 5.0 Tested up to: 5.2.3 -Stable tag: 2.0.17 +Stable tag: 2.0.18 License: GPLv3 or later License URI: https://www.udesly.com/terms-conditions-of-use/#udesly-wordpress-plugin -Requires PHP: 5.6.0 +Requires PHP: 7.0.0 Design your website in Webflow and connect it to WordPress with tons of plugins and unlimited features, on your own hosting! @@ -81,6 +81,9 @@ That's all! Absolutely! You can use the Udesly Adapter to create more than one website. == Changelog == += 2.0.18 = +* Added ACF function for tax image field + = 2.0.17 = * Fixed template redirect for custom post type diff --git a/includes/misc/acf.php b/includes/misc/acf.php index 3932c20..09e4158 100644 --- a/includes/misc/acf.php +++ b/includes/misc/acf.php @@ -7,6 +7,13 @@ die; } +function udesly_get_current_term($term) { + if (!$term || !is_object($term)) { + return get_queried_object(); + } + else return get_term_by('term_taxonomy_id', $term->term_id); +} + /** * * Gets image url based on ACF field @@ -34,6 +41,25 @@ function udesly_get_acf_image_url($field_slug, $subfield = false) return $image_field; } +function udesly_get_acf_image_url_term($field_slug, $term) +{ + $image_field = get_field($field_slug, $term); + if (empty($image_field)) { + return ''; + } + if (is_array($image_field)) { + return $image_field['url']; + } + if (is_numeric($image_field)) { + $image_src = wp_get_attachment_image_src($image_field, 'full'); + if ($image_src) { + return $image_src[0]; + } + return ''; + } + return $image_field; +} + function udesly_acf_subfield_oembed($field) { $oembed = get_sub_field($field); diff --git a/udesly-adapter-plugin.php b/udesly-adapter-plugin.php index 6235f03..907db35 100644 --- a/udesly-adapter-plugin.php +++ b/udesly-adapter-plugin.php @@ -11,7 +11,7 @@ * Plugin Name: Udesly Adapter * Plugin URI: https://www.udesly.com * Description: This is a support plugin for Udesly (Webflow to WordPress converter) that allows you to enable additional features for your theme. - * Version: 2.0.17 + * Version: 2.0.18 * Author: Udesly * Author URI: https://www.udesly.com * License: GPL-2.0+ @@ -29,7 +29,7 @@ // Constants defined('UDESLY_ADAPTER_PLUGIN_DIRECTORY_PATH') ?: define('UDESLY_ADAPTER_PLUGIN_DIRECTORY_PATH', plugin_dir_path(__FILE__)); defined('UDESLY_ADAPTER_PLUGIN_DIRECTORY_URL') ?: define('UDESLY_ADAPTER_PLUGIN_DIRECTORY_URL', plugin_dir_url(__FILE__)); -defined('UDESLY_ADAPTER_VERSION') ?: define('UDESLY_ADAPTER_VERSION', "2.0.17"); +defined('UDESLY_ADAPTER_VERSION') ?: define('UDESLY_ADAPTER_VERSION', "2.0.18"); defined('UDESLY_TEXT_DOMAIN') ?: define('UDESLY_TEXT_DOMAIN', "udesly-adapter-plugin"); defined('UDESLY_ADAPTER_PLUGIN_MISC_PATH') ?: define('UDESLY_ADAPTER_PLUGIN_MISC_PATH', plugin_dir_path(__FILE__) . 'includes/misc/');