I am trying to build a membership site, with CRED forms. The users can upload images in the form, but how can I get meaningfull image Alt and Title tags? SEO will be very important for the site, so it is quite an issue.
When you "Allow Media Insert button in Post Content Rich Text Editor" when you create your Post Form, there will be a native WordPress Image upload screen where you can set those details just as used to in WordPress.
If you use a Types Image Custom Field, the uploader does not present those features and they would either need to be updated to the Attachment via a Custom PHP Script, using values coming from as example some "Single Line" Custom Types Fields, or, you would use the autogenerated values.
Both ways to upload images create a Post of type "attachment".
The different Meta-Data is stored as this:
Alt Text: uses the Post Meta Key _wp_attachment_image_alt
Caption: it's the actual Post Excerpt (Table column name post_excerpt)
Description: it's the actual Post Body (Table column name post_content)
Thank you for your reply. I must say I am disappointed. One would expect something like this to be an essential part of the Cred forms. In these times when images are important and people search more and more with images it is not wise to publish images without alt and title tags.
The Allow Media is not an option, because I don’t want my frontend editors to see all media. So I will have to go to your second option, but that will cost me some time to puzzle. I will manage, but I dislike it. What is the function of Toolset if you still have to dive into PHP. I leave the issue open, because I don’t have the time yet to follow your suggestions and to test it.
Wouldn’t it be an idea to make a feature request of this issue for your developers? It would make CRED better.
Well, the thing is, even when you upload an Image via the WordPress Uploader, you still will have to edit those values, it's not automatically generated.
Once we will include the native Image Upload mechanism in CRED Fields (this is a project we are on), this can become possible.
But quoting your own statement, I think you will see why it takes a while to implement this:
"The Allow Media is not an option because I don’t want my frontend editors to see all media".
Exactly. So if we just implement native WP features, this would be the case. And obviously, we need to implement ways of making this either not possible or at least, as a setting to choose by the Admin.
It needs a careful planning and coding, along with considering all aspects of a Membership site.
For now, the only possibility is to use the CRED hooks I presented along with the functions of WordPress elaborated, with which you update those Details.
I understand your point of view, and I can say that we are working on better implementation of this, which means, the feature request you suggest exists already 🙂