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
- Why does WordPress use outdated jQuery v1.12.4?
- 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?
- Adding Widget form fields dynamically
- How Do I Use jQuery UI In My Plugin
- What is the correct way to build a widget using OOP
- Remove profile picture option (and other things) from profile.php (in admin)
- Widget development – Drop down options won’t save
- Calling the widget id of a mult-instance widget from inside the widget?
- Test to see if jQuery or Prototype is queued by another plugin?
- Is There A Hook To Process The Content Of The Text Widget?
- 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
- Edit the output of wp_widget_rss_output()
- How to trap “Publish” button to check for meta box validation?
- Script to remove all inactive widgets?
- Possible to preset a widget’s contents via a plugin script?
- Use js script from one plugin in another plugin
- Multiple entries in get_option results? or why is _multiwidget set to 1?
- How to add multiple copies of a widget from “available widgets”
- Install widget on plugin activation
- WordPress select dropdown list in widget
- wp_enqueue_style built in styles
- What is the difference between these two methods of writing $ instead of jQuery in WordPress [closed]
- Using $wpdb object in a widget
- Admin-ajax.php appending a status code to ajax response
- Plugin admin page meta_box toggle and order state not saving
- 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
- How to pass custom options from widget form to widget update callback?
- Broken markup when using the_excerpt() in a widget?
- Tips for targeting widget dragable for WP Pointer on widgets.php page
- Ajax in WordPress – path issue
- How to create custom field in worpdress default widgets?
- PHP 7 – Class Method Compatibility Issue
- Widget Admin – Form Submit Event?
- How to save WP widget instances and options
- Mixing Regular Javascript With jQuery in a Plugin
- 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?
- Widget update function not saving values
- jquery document ready function not being called [closed]
- Add custom element ID depending where the widget place is, sidebar or footer
- Customizer: widget-synced triggers twice
- Add a row on clicking each post featured image
- how to add Jquery script to one page?
- Add a class to a dynamic sidebar’s wrapper
- Is there an event or an other method that tells me the preview is loaded?
- Widget is to be compatible with all themes
- Are there any scripts, classes, and/or functions built-in to WP for a plugin to export/import its saved data from wp_options?
- how to search users by ajax live search
- Ajax contact form widget plugin data not insert in database
- jQuery selectors for editor elements safe to use?
- Display WordPress the_content() via data attributes
- javascript datatables in a plugin
- Widget Dropdown doesn’t working
- How do I get the sub categories of the parent when in a sub category?
- How to limit number of number of categories displayed by categories widget
- 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”
- Dynamically creating classes for Widget API
- Widget options are not updated
- Why does my widget break other widgets?
- jQuery does not enqueue for my purpose… (before an inline script in the footer)
- CSS not affecting widget output
- Plugin – Make sure jquery is loaded in my settings page plus my JS file
- Using a multiple element in widget form
- jQuery in WordPress Plugin
- Problem with saving checkbox values with WordPress Widget API
- WP Plugin Running before jQuery
- 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 include jQuery into my plugin so I can use it on plugin page?
- Ajax submit result opens in admin-ajax.php
- how to get the post id in plugin
- Jquery was not found on this server
- insert query on a custom table using ajax with jQuery plugin Jeditable
- How to enqueue scripts in right way in a 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
- Data not insert and update through ajax and jQuery in admin page?
- WP ajax requests not stacking?
- Need help about understand api, wp, $ syntax in WordPress plugin script