Created
September 24, 2024 05:46
-
-
Save aimahdi/00a0c1dbca9e4ca6fdd514c0c8e03fc6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('fluentform/rendering_field_data_custom_html', function ($data, $form) | |
{ | |
if($form->id != 50) { //change the form id with your own form id | |
return $data; | |
} | |
global $post; | |
$thumbnail_id = get_post_meta( $post->ID, '_thumbnail_id', true ); // Get the thumbnail ID | |
if ( $thumbnail_id ) { | |
$image_url = wp_get_attachment_image_url( $thumbnail_id, 'full' ); // Get the image URL | |
$data['settings']['html_codes'] = '<img src="' . esc_url( $image_url ) . '" width=300, height=300 alt="" />'; // Display the image | |
} | |
// Do your stuffs here | |
return $data; | |
}, 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment