When adding an image as a background on a row the absolute URL is used - this is a problem when developing locally as when migrating to production site the image will be missing.
This will not be picked up by database tools like WP Migrate Pro as the CSS is stored in files.
How can a relative URL be implemented automatically.
This won’t work as the URLs for what I am referring to are not stored in the database they are stored in the Beaver CSS cache files in the uploads folder.
No your not missing anything, thing is a lot of CSS/JS files are cached and used to control layout.
Search and replace on a number of files(example attached) is error prone, better solution would be to give the option to use relative URLs in this instance.
If you are using a local dev > staging > production workflow - thats quite a manual task on a site that changes a lot while its being developed.
I see what you mean. Try this in your theme’s functions.php: update_option(‘upload_url_path’, ‘/wp-content/uploads’);
Just use it while in production then comment out when the site is migrated - could probably use more testing but it’s a starting point.
Use the function update_option() to update a named option/value pair to the options database table. The $option (option name) value is escaped with $wpdb->prepare before the INSERT statement but not the option value, this value should always be properly sanitized.
Hey Neil, you can just remove the Beaver Builder cache folder and it will regenerate everything based on the current URL. There’s more detailed information on how to do that in our new Knowledge Base:
Honestly, I don’t think we’ll every implement relative URLs in Beaver Builder. Using an absolute URL/URI is considered the best practice for a variety of reasons. I found a pretty interesting debate on this subject here–if you’re curious:
Thinking about it, we might add a clear cache button to the Beaver Builder settings panel. That would probably alleviate some of the inconvenience of migrating sites