You don’t need a shortcode in a traditional sense. You could use something like {imageurl=""http://google.de/aImage.jpg}
You would use the filter content_save_pre
to run before the content is saved to the database a search and replace with the img markup which you get from media_sideload_image()
. media_sideload_image()
downloads the image from a URL adds it to the media manager and then return the img markup.
Have a look how wp_make_content_images_responsive()
works. It something similar as it replaces the old img forma with the responsive image format.
Related Posts:
- Conditionally Loading JavaScript/CSS for Shortcodes
- Pass boolean value in shortcode
- Escaping quotes from shortcode attributes
- How to add ‘class’ attribute into shortcode [audio]?
- Automatically add this attribute to the gallery shortcode
- How to handle valueless attributes in shortcodes?
- Get multiple shortcode attribute values
- wpautop() when shortcode attributes are on new lines break args array
- Remove width and height attributes from [gallery] output
- Add attribute to existing Shortcode
- Shortcode displays only default attribute values
- Extending Shortcode attributes
- Remove HTML content if attribute is not set / variable attributes
- Global, network-wide shortcodes or text replace functions
- getting values from a shortcode with an include
- Why are Shortcodes Disabled in Widgets by Default?
- Add attribute to shortcode dynamically
- Caption shortcodes not including caption as attribute
- Conditionally Loading JavaScript/CSS for Shortcodes
- Check if CTP category taxonomy is set in shortcode
- Passing variable in nested shortcodes
- How to use a nested shortcode to render the value of an attribute in parent shortcode
- Which wordpress function is the caption shortcode linked to?
- How to process a single attribute in a SQL request twice times?
- shortcode atts not working
- Second attribute of shortcode is not changing why?
- Replace custom gallery shortcode with default gallery shortcode
- Shortcode Attribute contains clone of all shortcode attributes
- How can I define the output of shortcode attribute value?
- Remove width and height attributes from [gallery] output
- Why are you using add_action for shortcode?
- How to get URL param to shortcode?
- Native “playlist” shortcode random playing… How?
- How to display the names of users from a specific group with a shortcode?
- shortcode for logo image
- Stop strip_shortcodes() stripping content inside shortcodes
- How do i link gallery thumbnails to different url’s using the wp native gallery?
- Gallery shortcode menu order fix no longer working on WordPress 4.0
- How to save a shortcode in a Gutenberg custom block?
- Is shortcode_unautop() broken?
- Can a shortcode function this way
- Dynamically create shortcodes using add_shortcode and a callback
- Passing attributes to shortcode dynamically
- Stop parsing shortcodes
- Meta tags in shortcode
- shortcode javascript not working on custom template file inside theme folder
- Compatibility of MathJax extension and JetPack [closed]
- How to add class or id to shortcode HTML elements?
- Change WordPress Shortcode added in to post
- Changing the title tag from a shortcode
- WordPress wpautop/shortcode generating invalid markup
- While loop shortcode problem
- Remove ‘p’ tags around shortcodes and ‘img’
- Execute Closing Shortcode After the_content
- Forcing max-width for image captions
- WordPress Short code with additional parameter
- Replace shortcode in substring
- Creating a short code with php inside
- How do I apply style to each category of a list?
- Is it possible to modify the header with a content shortcode?
- this simple shortcode doesn’t generate Collapse as supposed
- Shortcode outputting at top of content
- Will a shortcode placed inside a paragraph tag still be valid?
- Create Widget or Enable Shortcodes in Sidebar
- Shortcode Strategy
- Enclosing Shortcode is acting like self-closing
- How do I define and register a shortcode function in a namespaced functions.php file?
- Change user meta value with shortcode
- Implementing a URL Shortener
- WordPress User ID as Shortcode
- Duplicated content with custom shortcode
- shortcode – multiple instances of same parameter name in one shortcode instance
- Clean way of using ob_start() and ob_end_clean() in wordpress
- Theme Convert PHP code to shortcode
- find shortcode inside content of post
- WordPress Short code for List style
- Adding a cover image to video shortcode
- How can I replace content on site generated from plugin without changing plugin
- How can i strip shortcode from HTML title tag?
- Show content if user left comment / non-logged visitors?
- How to insert current user ID/entry ID into a shortcode?
- Need help with creating a simple shortcode
- Using a WP shortcode in Homepage
- i want to show a modal when user lands on home page very first time
- Having trouble creating two shortcodes, one for logged in user and one for visitors
- Logout user if click on a custom page link
- Shortcode Attribute not defined
- WP_User_Query Search Multiple Keywords from a Multi-Select Field?
- Is Post-Author-Id shortocde
- Load next post by ID on a single page
- Add catagory attribute to custom shortcode
- Class variables in shortcodes
- Separating Custom Template logic
- Shortcode for sectors
- How to not show shortcode contents if cart is empty?
- Help with Shortcode Functionality
- Shortcode Site include in a other
- How do write this type shortcode? [closed]
- WordPress functions.php shortcode is not working [closed]
- My first WordPress shortcode just returning []