Image thumbnails on entries

This documentation page is for Quform version 1 and may not be applicable for Quform 2 click here to visit the documentation for Quform 2.

Add the following code to the wp-content/themes/YOUR_THEME/functions.php file (or create a plugin for it).

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
function my_entry_image_thumb()
{
    ?>
<script>
    jQuery(function ($) {
        $('.iphorm-entry-cell > a, .iphorm-entry-table td > a').each(function () {
            var $link = $(this),
                href = $link.attr('href');
 
            if (/(jpg|jpeg|png|gif)$/i.test(href)) {
                var $img = $('<img>').attr('src', href).css({ 'max-width': 200, 'max-height': 200 });
                $link.html($img);
            }
        });
    });
</script>
    <?php
}
add_action('admin_footer-quform_page_iphorm_entries', 'my_entry_image_thumb');
function my_entry_image_thumb()
{
    ?>
<script>
    jQuery(function ($) {
        $('.iphorm-entry-cell > a, .iphorm-entry-table td > a').each(function () {
            var $link = $(this),
                href = $link.attr('href');

            if (/(jpg|jpeg|png|gif)$/i.test(href)) {
                var $img = $('<img>').attr('src', href).css({ 'max-width': 200, 'max-height': 200 });
                $link.html($img);
            }
        });
    });
</script>
    <?php
}
add_action('admin_footer-quform_page_iphorm_entries', 'my_entry_image_thumb');
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy