• Hello,

    I put an image file into my registration form. And it shows up in the “edit user info”, but it doesn’t show when I try to put it into a page using the shortcode [wpmem_field field=”memberpicture”]
    It does work for all the other things, and it’s not because I made this one myself cuz I made another field and that one does show up.

    So yeah, any ideas why?

    Oh and it doesn’t show the picture but it does show 4 numbers?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Chad Butler

    (@cbutlerjr)

    So yeah, any ideas why?

    Yes – the shortcode wasn’t written with that in mind. (That’s the short answer – long answer to follow…)

    Image/file upload is a relatively new feature in the plugin. Like many of the plugin’s features, it was added due to overwhelming user request.

    Likewise, the shortcode to directly display a field value was added for the same reason (although it was added long before the upload functions).

    When things get added, they are generally added based on what users are asking for and while I try to think through possible scenarios, there are tons of possible ways the plugin ends up being used, so I don’t usually think of everything. If it’s not something that was thought of, then it doesn’t come up until someone uses it in a way other people aren’t using it and then asks a question about it.

    When files are uploaded, they are given an attachment (a WordPress post type) ID. That’s what is saved in the meta data for the user. From that post ID, we can create links or gather information about the attachment.

    So the numbers you are seeing are the actual value of the stored field.

    The shortcode only does what it is programmed to do, which currently is to display the value that is saved for a user for a given field. So in this case, it is displaying exactly what is saved in meta for that user for that field.

    Recently (last update) the shortcode was updated to better accommodate fields that use a different saved value than their displayed value (dropdowns, multiple select/checkbox, radios). We can certainly add functionality to accommodate images and files as well.

    There are a lot of possibilities with this. I’ll introduce it in the next update (which I expect to be released soon, and there is a beta version on github). In this case, it may be subject to (slight) change. I have to think through the process a little bit.

    My initial thought is to just have [wpmem_field field=some_field] display an image if it is an image and a link if it is a file. But I still want to accommodate things that may require custom handling, so I would want to offer the opportunity to display the raw value (which is the post ID) for use in some other capacity.

    I’ll need to decide which one of those is the default and which one can be generated by additional attributes. I’d lean toward displaying the image as the default and getting the ID by attribute since that seems like it would be more intuitive for the average user.

    Also, I’ll need to work on attributes for display size. Images are automatically resized into some additional sizes. I’ll probably default here to the actual image and use an optional attribute to select a different size.

    For now, the beta mentioned above has the update to display image. (Note: that’s subject to change prior to official release based on some of the items mentioned above.)

    Thread Starter veraapoes

    (@veraapoes)

    Oh wow, thanks for such an amazingly detailed answer 😀

    Then i’ll just wait for the next update and see what will change. If it wont come I’ll just wont put the picture on the profile section because it looks good as it is thanks to this amazing plugin. But yeah, the picture would give it a little extra.

    But thank you very much ! 🙂

    Plugin Author Chad Butler

    (@cbutlerjr)

    The 3.1.5 update addresses this directly and includes some additional support for default image sizes and custom size.

    The image will display the thumbnail by default if no size is specified:

    [wpmem_field my_image]

    Default sizes can be passed in the “size” attribute. For example:

    [wpmem_field my_image size=medium]

    Possible size attributes are:

    • thumbnail (the default size)
    • medium
    • large
    • full

    The size attribute can also specify a custom size as width/height in pixels. For example, the following would display my_image as 300px wide by 200px high:

    [wpmem_field my_image size=”300,200″]

    If the attachment (post) ID is desired, that can be displayed using the display=raw attribute:

    [wpmem_field my_image display=raw]

    (Also note that the [wpmem_field] shortcode was updated to no longer require that the field be set with the “field” attribute – so you can use [wpmem_field my_field] OR [wpmem_field field=my_field] – either will work, but one is obviously less typing.)

    There is more information on the new attributes for the shortcode here:
    http://rocketgeek.com/plugins/wp-members/docs/shortcodes/field-shortcodes/

    Thread Starter veraapoes

    (@veraapoes)

    THIS IS PERFECT! 😀 Thank you so very much!

    Plugin Author Chad Butler

    (@cbutlerjr)

    No problem! It was one of those things that made perfect sense to get into place.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Image doesn’t show’ is closed to new replies.