To whom it may concern,
I am trying to: save a relative path to an image though there is server side and client side validation stating 'Please enter a valid URL address pointing to the image file.'
Link to a page where the issue can be seen: According to https://toolset.com/forums/topic/relative-links-on-image-uploads/ this was scheduled for version 2.5 and I'm currently using 3.0.8
I expected to be able to submit a relative path due to the fact that WordPress offers this setting via the following:
define('WP_CONTENT_URL', '/wp-content');
Thanks,
Hi, an absolute URL is required for all custom field images. WordPress Media Library image paths work the same way - they are stored in the database using absolute URLs. It looks like the other ticket was about how the paths to images are written in the markup on the front-end of the site. In other words a custom field image tag looks like this when output on the front-end of the site:
<img src="<em><u>hidden link</u></em>" />
The client was requesting something like this instead:
<img src="../../uploads/2018/06/some-image.jpg" />
Obviously that would have to be dynamic based on the current URL. There was a feature request added to support this type of image path output, but it is not scheduled to be included in a specific upcoming release, and I haven't seen any development progress towards this feature. Sorry for the misinformation in the other ticket. For now, you must use an absolute URL for all custom field images.
This ticket can be closed since the question has been answered as not being supported atm.