How to retrieve a value from an input field in a media view template

After digging through the media modal code, I came up with the answer to my question: wp.media.controller.Custom = wp.media.controller.State.extend({ initialize: function(){ this.props = new Backbone.Model(); }, // called when the toolbar button is clicked customAction: function( controller ){ // get the value of a media view template form field using // this.props.get(‘key’), where ‘key’ is … Read more

backbone fetch() not working

fetch returns a promise, so you want to wait until the promise is resolved. For example: new wp.api.models.Post( { id: 1 } ).fetch().then( console.log ); or doing something with the data: new wp.api.models.Post( { id: 1 } ).fetch().then( post => { console.log( post ); } ); To address your comment, Promises are async – so … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)