I also noticed a typo in the url media-upload.php?type=image&&TB_iframe=1
. Maybe this is the problem.
Also a working example:
jQuery( 'input[id^=my_field]' ).live( 'click', function($) {
formfield = $( 'input[id^=my_image]', $(this).closest('.widget') ).attr( 'name' );
tb_show( '', 'media-upload.php?type=image&TB_iframe=1' );
return false;
} );
Related Posts:
- Using Ajax call in jQuery doesn’t work in widget
- ajaxurl not defined on front end
- How to add a javascript snippet to the footer that requires jQuery
- How to include jQuery and JavaScript files correctly?
- Custom Widget function in Plugin not working?
- How Do I Use jQuery UI In My Plugin
- Remove profile picture option (and other things) from profile.php (in admin)
- Test to see if jQuery or Prototype is queued by another plugin?
- jQuery in header or footer
- Hook the Keydown Event in the TinyMCE Post Editor
- Add content to widget title in admin area within the widget?
- Has anyone managed to integrate the wp_editor inside a widget?
- Add a jQuery function to admin pages
- How to Add a .js file Only in one specific Page Dynamically to Head
- Is dynamic forms/entries possible in Widget?
- Using preg_replace to clean widget output HTML
- Script to remove all inactive widgets?
- Multiple entries in get_option results? or why is _multiwidget set to 1?
- What is the difference between these two methods of writing $ instead of jQuery in WordPress [closed]
- Using $wpdb object in a widget
- WordPress plugin options and jQuery
- Is there a need to do apply_filter(‘widget_title’, $instance[‘title’]) or any other ‘widget_xxx’ filters?
- Dynamic content in a widget
- Tips for targeting widget dragable for WP Pointer on widgets.php page
- Ajax in WordPress – path issue
- PHP 7 – Class Method Compatibility Issue
- How to save WP widget instances and options
- Can I individually style items in the backend widget list?
- Loading jQuery and jQuery plugin script files correctly [duplicate]
- Sidebar widget to show popular post not working?
- Add custom element ID depending where the widget place is, sidebar or footer
- Add a row on clicking each post featured image
- Add a class to a dynamic sidebar’s wrapper
- how to search users by ajax live search
- Ajax contact form widget plugin data not insert in database
- Display WordPress the_content() via data attributes
- javascript datatables in a plugin
- Input in plugin widget does not allow spaces
- Get draggable widgets on Edit Post page
- WordPress custom taxonomy check box to dropdown
- Hide shortcodes “code” when using the “editor” the same as wordpress do with “gallery”
- Widget options are not updated
- Why does my widget break other widgets?
- CSS not affecting widget output
- Plugin – Make sure jquery is loaded in my settings page plus my JS file
- Problem with saving checkbox values with WordPress Widget API
- jquery & ajax sending data to php
- should i be checking for jquery before enqueing it in a plugin
- jQuery instantly executes (a button click and css change) on load
- how to get the post id in plugin
- Are there any official or unofficial guidelines for the styling of a widget?
- Create Widget or Enable Shortcodes in Sidebar
- making a plugin that moves other plugins wp_head actions to wp_footer
- Minimum Widget Width for Plugin Development
- Ajax: Populate with content from a post’s ID not working – duplicating current page html instead
- How to create a wordpress widget that dynamically changes according to the page
- jquery in wordpress plugin with depdendency
- ajax working when function is on child theme but not in plugin page
- Ajax +wordpress onClick link redirect to new page and create html content
- Use options to control jQuery plugin
- How to localize data array in plugin’s option page
- sanitizing/escaping plugin options
- Can / should a widget plugin define its own Widget Area?
- How to exclude categories from get_categories() select list inside a widget admin panel
- Widget internal hooks and functions
- Using jQuery prepend() with file include
- My plugin creates custom widgets, How can I programatically add them to existing sidebar widget areas?
- How to show multiple instances of the WP125 Widget?
- Ajax on the Administration Side of plugin – returns 0
- escape html in jQuery for WordPress
- Jquery php request is returning a weird result
- Query String Filtering API
- How does update method in Widget class saves $instance array from Select tag?
- jQueryUI draggable doesn’t work in WordPress plugin
- setTimeout not working in jquery
- WordPress Jquery with heade and footer sritp plugin
- Load script on frontend from widget plugin
- Can’t get wpColorPicker to work in a widget
- wp_ajax add_action fuction won’t fire on custom jQuery action
- Set widget icon in Customizer?
- Filterable posts using categories
- How to get values from Tinymce visual editor popup?
- WordPress function is not called and ajax return 0
- Ajax call not working with
- Widget won’t be activated
- Dynamic sidebar areas not working on the Theme Customizer
- How can I add the Post ID to Class Name in Jquery?
- Downloading Generated XML File
- Detect each active instance of a widget
- Script work on non logged in user but not work for logged in user?
- grouping my widgets wordpress
- Get fields of a widget
- Cannot echo a JS variable to a jQuery plugin coming from wp_localize_script
- How do I create Widget within plugin that uses its own class?
- Best practice to include custom user styles in widgets
- Page reload occurs before request finishes
- How do I use (or mimic) document.getElementById() on a page loaded from WordPress database?
- How to get the value entered in the input field in wordpres
- Is it possible to add Custom Dashboard Widgets to Custom Admin Menu Page?
- Insert meta-description into Yoast-SEO input-field via JavaScript