88 posts
  • Sold between 1 000 and 5 000 dollars
  • Has been a member for 3-4 years
  • Bought between 1 and 9 items
  • Exclusive Author
DesignPuma says

Some useful tutorial to all authors here about How to use WordPress 3.5 Media Uploader in Theme Options.
Special thanks to Ram Ratan Maurya

5 posts
  • Bought between 1 and 9 items
  • Has been a member for 2-3 years
  • Exclusive Author
  • India
RamRatanMaurya says

Some useful tutorial to all authors here about How to use WordPress 3.5 Media Uploader in Theme Options.
Special thanks to Ram Ratan Maurya

Thanks for bringing this here. Previous code had some bugs which was preventing WordPress to ad new media from edit post screen once you uploaded a file which uses this code.

However, I have solved it and it works fine now. If you have used this code in your theme I suggest you to update it with latest code on site. Thanks.

39 posts
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
  • Europe
  • Exclusive Author
  • Has been a member for 2-3 years
  • Envato Studio (Microlancer) Beta Tester
  • Bought between 10 and 49 items
  • Referred between 50 and 99 users
DeliciousThemes says

Thanks for sharing this resource. Although the old uploader is still there(WordPress allows us to make use of it to not break themes) keeping steps with WordPress is a must as it gets better and better each month.

491 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Won a Competition
  • Referred between 1000 and 1999 users
  • Author had a Free File of the Month
  • Author had a File in an Envato Bundle
  • Bought between 10 and 49 items
+3 more
pixelentity says

The solution in the tutorial works but it only restores the default behaviour when the media uploader is opened by clicking on the “add media” button. This may not be always the case as a plugin or theme could use javascript for whatever reason.

Here’s an alternate method which relies on events to restore the original function after the image has been added or the uploader closed by clicking “close” button or using “ESC” key:

https://gist.github.com/4452118

BF

107 posts
  • Exclusive Author
  • Has been a member for 2-3 years
mailmilisku says

Some useful tutorial to all authors here about How to use WordPress 3.5 Media Uploader in Theme Options.
Special thanks to Ram Ratan Maurya
+1. Thanks!
491 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Won a Competition
  • Referred between 1000 and 1999 users
  • Author had a Free File of the Month
  • Author had a File in an Envato Bundle
  • Bought between 10 and 49 items
+3 more
pixelentity says

The new media uploader api is amazing as much as its complete lack of documentation. So i started digging into the javascript sources, a few hours (and a good amount of blasphemies) later, i was able to come out with a working example:

WordPress 3.5 media upload api example

5 posts
  • Bought between 1 and 9 items
  • Has been a member for 2-3 years
  • Exclusive Author
  • India
RamRatanMaurya says

pixelentity, that snippet does great. I was just about to post the same here. At the end result, I came up with same, but a slight different version of the same.

Here is the link to WP3.5 API

491 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Won a Competition
  • Referred between 1000 and 1999 users
  • Author had a Free File of the Month
  • Author had a File in an Envato Bundle
  • Bought between 10 and 49 items
+3 more
pixelentity says

Needed to add a custom image filter, again no docs on the subject, most likely broken the swearing world record, here’s an example:

WordPress 3.5 media upload api: toolbar with custom filter

BF

116 posts YeahThemes
  • Exclusive Author
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
  • Has been a member for 3-4 years
  • Bought between 1 and 9 items
  • Referred between 100 and 199 users
Manh says

pixelentity, that snippet does great. I was just about to post the same here. At the end result, I came up with same, but a slight different version of the same. Here is the link to WP3.5 API

And use the on() function instead of live() because it have been deprecated.

116 posts YeahThemes
  • Exclusive Author
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
  • Has been a member for 3-4 years
  • Bought between 1 and 9 items
  • Referred between 100 and 199 users
Manh says

Needed to add a custom image filter, again no docs on the subject, most likely broken the swearing world record, here’s an example:

WordPress 3.5 media upload api: toolbar with custom filter

BF

Thanks for sharing this snippet ,dude!

by
by
by
by
by
by