Skip Navigation

[Resolved] Image field can not be saved with relative urls

This support ticket is created 6 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 2 replies, has 2 voices.

Last updated by financeO 6 years, 5 months ago.

Assisted by: Christian Cox.

Author
Posts
#1107625

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,

#1107660

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.

#1107664
database.PNG

This ticket can be closed since the question has been answered as not being supported atm.