In the same call where the image URL is being sent to the editor, you fill up another div with an image source.
Like:
window.send_to_editor = function(html)
{
imgurl = jQuery('img',html).attr('src');
jQuery('#upload_image').val(imgurl);
imgsrc="https://wordpress.stackexchange.com/questions/82427/<img id="upload_image" name="upload_image" src=""+imgurl+'">';
jQuery('#image-holder').html(imgsrc);
tb_remove();
}
PS: this is for the Old Thickbox, not for the New 3.5 Uploader, which has very few examples nowadays.
[update]
In the original theme page code, the image should be wrapped in:
<div id="image-holder"><img id="upload_image" name="upload_image" src="https://wordpress.stackexchange.com/questions/82427/<?php if ($options["upload_image'] != "" ) { echo $options['upload_image']; } ?>" /></div>
Related Posts:
- Hook in wp.media to add a new tab
- Overide get_template_part( ‘partials/post’, ‘sidebar’ ); with a plugin
- What’s the earliest point I can get the queried object ID?
- Using Primary Color in Plugin Block
- Using a Theme inside a Plugin directory
- Plugin development without Theme adjustments?
- What is the best way to provide plugin users with a way to customized the styles
- Programmatically Selecting Theme Based on URL
- How to properly use a hook to create template for custom product type in a plugin such as Woocommerce? [closed]
- Fully automated theme install and activation via a plugin
- Calling plugins API within a theme
- Hook into theme-switching later than `setup_theme`
- WordPress security issue to output data from user input from theme option form
- Which themes do you use to test compatibilities with your plugin [closed]
- How to Debug: My Plugin Interferes With My Theme
- Theme Install using a Custom Repository
- How to create a backend for a custom theme?
- How to make “upgrade safe” theme for a plugin?
- Are there any official or unofficial guidelines for the styling of a widget?
- Get images / media attached to a page by page ID
- Create fixed static pages
- How To Protect Plugin Display From Being Affected By Theme’s CSS
- Displaying custom content from a plugin within the active theme
- Getting Post ID at “stylesheet” and “template” hooks
- WordPress admin panel not working
- Override category archive page title (not the head title)
- How to hide/remvoe unnecessary field/section in post edit section ( Dashboard )
- Redirect theme directory to plugin theme directory
- Adding and handling custom settings tab to fusion element
- Post Pagination does not working on WP-Query
- Managing Custom Designed Content
- Create and style menu
- Developing Themes on WordPress, Looking for Excellent Tutorials [closed]
- Find Any Theme’s page.php File
- Update Option Stored in Multi-Dimensional Array
- check if Gutenberg is currently in use
- WordPress Plugin Development – Headers Already Sent Message
- Best practices for using the transients API
- $wpdb->insert_id
- Remove profile picture option (and other things) from profile.php (in admin)
- How Can I Add a Filter to Class Instance Only?
- Getting old term value with edited_{$taxonomy} | Hook
- Call activation hook multiple times
- Adding custom code into header.php using a plugin
- Two-step login process – Is it possible?
- Calling clean_term_cache() fails when called in the same plugin that creates terms, succeeds when called separately?
- Singular name Plugin localization
- Using $wpdb object in a widget
- Unified Approach for Placing Option Pages
- Define a function outside a class and call the function using action or filter hook
- Modifying WordPress plugins
- On plugin deactivation hide its shortcode
- Can I submit a plugin that follows the PSR-2 coding style guide?
- How to get current page id through the plugin
- WordPress removing data attributes for scheduled post
- WYSIWYG editor in WP 3.2 plugin
- Verify Nonce returns false – Request Nonce returns correct value
- How to untrash a post only if it was not a draft?
- Can I change header.php of current theme through a plugin function?
- Gutenberg blocks not getting styled on back end
- Writing a plugin which needs to upload files
- Calling is_single() outside the loop
- update woocommere total value on checkout based on selected payment method
- Add a Save Button to Custom Meta Box [duplicate]
- Gutenberg: import dependency or assign from global variable?
- How do I update a field of a meta box?
- Following WordPress Markup Is mandatory, got awkward resultyby wordpress standard markup?
- Steps to Update a WordPress Plugin That We Developed
- Problems with cron
- dbDelta not installing database
- How do I add a favicon that only shows during viewing of my plugin’s admin panel?
- Remove Default Blogroll Links via Plugin script
- Catching Form Submission in WordPress Admin Panel
- I receive taxonomy id
- Filter posts in pre_get_posts order by meta value date (desc or asc)
- How to display the category id along with category name on categories list?
- Save temporary registration data
- Activate / Deactivate plugin
- Serial Number from custom table not appear in woocommerce_email_before_order_table action
- How to replace the existing metatag using the backend to insure a thumbnail image gets fetched when we share on social media?
- When setting styles to an extended block that was saved as a pattern, it doesn’t remove the style that was there
- Always hide a page from the menu
- Author Meta in Author URL Link
- Update database record in plugin
- Different style for specific rows in custom list table using WP_List_Table
- get_comment_meta() for a filter hook in a plugin
- form does not generate $_POST request
- Callback function quicktags that uses variable in start tag
- Font Awesome stopped showing icons, shows &# text instead [closed]
- WordPress Plugin Tool Tip Helpers
- How can I add the Post ID to Class Name in Jquery?
- How to show metabox just in post.php in admin?
- Can I use a hook other than ‘init’ to handle form submissions?
- Stop theme displaying comments
- Plugin capabilities
- plugin will not offer update even though a new version is available
- Deactivate plugin on registration
- How to filter manage categories listing
- Enqueue Script in custom plugin before other
- How to remove a class [closed]