wordpress 3.5 media manager - add my own backbone.js views wordpress 3.5 media manager - add my own backbone.js views wordpress wordpress

wordpress 3.5 media manager - add my own backbone.js views


I'm not sure if you ever found an answer to your question, but I wanted to let you know that I got the above code to work for me by simply fixing references to "media" objects that were not prefixed with "wp." So...your new custom state code should look like this instead:

file_frame.states.add([new wp.media.controller.Library({    id:         'mystate',    title: 'my title',    priority:   20,    toolbar:    'select',    filterable: 'uploaded',    library:    wp.media.query( file_frame.options.library ),    multiple:   file_frame.options.multiple ? 'reset' : false,    editable:   true,    displayUserSettings: false,    displaySettings: true,    allowLocalEdits: true,      //AttachmentView: ?}),]);

I personally wanted to REPLACE the initial default state of the 'select' frame, which I achieved by adding states : 'mystate' to the file_frame options, causing the initialization to return without creating the default 'select' state. And then proceeded with creating 'mystate' as you demonstrated (with the two minor changes in object syntax).

My thanks go to you for the lead in methodology here! It worked perfectly, and I was completely lost and frustrated prior.