From 45cc06190280514ec0e4a7c7debd168393e036a3 Mon Sep 17 00:00:00 2001 From: Peter Oslington Date: Tue, 1 Feb 2022 14:30:36 +1100 Subject: [PATCH] Added image formatting support for url results --- shortcodes/civicrm/api4-get.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/shortcodes/civicrm/api4-get.php b/shortcodes/civicrm/api4-get.php index 34db913..db37168 100644 --- a/shortcodes/civicrm/api4-get.php +++ b/shortcodes/civicrm/api4-get.php @@ -160,6 +160,11 @@ public function shortcode_callback( $atts = [], $content = NULL, $tag = '' ) { ' alt="' . ( $m['alt'] ? htmlentities( $m['alt'] ) : '" role="presentation' ) . '">'; } + } elseif ( preg_match( '/^img( : (? \d+ %? ) x (? \d+ %? ) | : alt= (?.*) | : [^:]* )* /x', $match['format'], $m ) ) { + $output = '' . ( $m['alt'] ? htmlentities( $m['alt'] ) : ''; } else { if ( is_array( $output ) ) { $output = implode( ', ', $output );