Skip to content

Instantly share code, notes, and snippets.

@jessepearson
Created January 13, 2015 00:49
Show Gist options
  • Save jessepearson/c6e3f7dc105ca87a9e79 to your computer and use it in GitHub Desktop.
Save jessepearson/c6e3f7dc105ca87a9e79 to your computer and use it in GitHub Desktop.
Using WordPress jQuery widget added callback
// if a widget is added, then initialize the media_uploader in that widget
$( document ).on( 'widget-added', function( event, target ) {
init_media_uploader( target );
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment