• Resolved Peter Berger

    (@peterpolow)


    Hi Eliot,

    I just want to let you now that I get the following PHP error (with WP_DEBUG and/or Query Monitor activated) when I define the “size” in an image of a gallery field.

    Notice: Undefined index: size in \wp-content\plugins\custom-content-shortcode\includes\core\content.php on line 1198

    With the result is nothing wrong, the correct size of the image shows up (I tested it with different image-sizes).

    The shortcode I use is like:

    [loop type="fotoalbum"]
    <div class="fotoalbum-item"><a title="[field title]" href="[field url]">[if field="image"][field image size="thumbnail" image_class="aligncenter"][else][content field="gallery" num="1" size="thumbnail" image_class="aligncenter"][/if]</a></div>
    [/loop]

    I get 4 errors when using the shortcode above. I hope it can help you to improve the code.

    https://ww.wp.xz.cn/plugins/custom-content-shortcode/

Viewing 1 replies (of 1 total)
  • Plugin Author Eliot Akira

    (@miyarakira)

    Hello,

    I tracked it down to [if field="image"] – it was using a function in [content] directly, and the default image size hadn’t been set yet. I corrected it in the latest plugin update. Thank you for telling me about this!

Viewing 1 replies (of 1 total)

The topic ‘PHP error when define "size" in image or gallery field’ is closed to new replies.