Viewing 1 replies (of 1 total)
  • Plugin Author Irshad Ahmad

    (@irshadahmad21)

    Hello,
    Array fields are not supported. The field needs to return a string in order to sent to Telegram.

    You can use some custom code to ensure that a string value is returned.

    Here is an example that uses the first image of the gallery in place of a featured image

    /* WP Telegram - use first image from ACF gallery */
    add_filter( 'wptelegram_p2tg_featured_image_source', function ( $url, $post ) {
    
    	$images = get_field( 'model_gallery' );
    
    	if ( ! empty( $images ) ) {
    		$first_image = reset( $images );
    
    		$url = is_array( $first_image ) ? $first_image['url'] : wp_get_attachment_url( $first_image );
    	};
    
    	return $url;
    }, 10, 2 );
    /* WP Telegram - use first image from ACF gallery */
Viewing 1 replies (of 1 total)

The topic ‘Acf image gallery’ is closed to new replies.