• Resolved hydevelop1994

    (@hydevelop1994)


    hi guys i trying to show my image from my post (not feautred image)
    so after checking i know my custom field is like
    {cf:model_gallery}

    but the result send into my channel become
    “array” inside the content

    `?? My Name : ALICE

    ??Model of TODAY!!??

    ??Website Link :
    https://www.com

    Array <—————– the {cf:model_gallery} become Array

    ??Booking Whatsapp :
    123123123

    ??Operation hour??
    ??11:00am – 1:30am??

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.