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 the value of its
// 'data-setting' attribute
console.log('width: ' + this.props.get('width'));
console.log('height: ' + this.props.get('height'));
}
});
Related Posts:
- Show only images and videos in a wp.media window
- Open media frame and select an attachment
- Customizing the 3.5 “Add Media” popup (Backbone.js)
- Switch to the library tab in the media uploader
- What type of template are WP media-modal’s templates?
- Restrict file types in the uploader of a wp.media frame
- Only displaying zip files with wp media
- Insert HTML markup to page content from the Media Frame modal
- Display attachments by ID in a wp.media frame
- Custom “Uploads” Dir: “Edit Image” in Media Library broken
- Refresh wp.media after ajax call
- Filter medias from the Media Uploader (wp.media) modal with a post meta
- Rest API invalid nonce with Backbone Client
- Sending custom data with Media Frame Model
- window.send_to_editor throws unterminated string literal error when adding image with multi line description
- Uppload image from another source wp.media
- Multiple media uploader buttons target only one input on the same page
- Setting/unsetting terms using the Backbone JavaScript client
- Modal working only on home page
- Is there a media_upload_tabs-similar filter to add tabs to the simple/featured image picker?
- How to open the add media dialogue it in a certain state / tab?
- Building a Featured Gallery component for Gutenberg
- How to render WP Rest-API Endpoints in a React.js Theme with Woocommerce
- Check if user can in javascript
- wp-api Backbone JS Client fetch options
- Access checks with custom REST endpoints and backbone
- Is there any halfway decent documentation on the wp.media JS class?
- How can I submit a form using JavaScript?
- How do I get the current date in JavaScript?
- How to do a redirect to another route with react-router?
- Jest spy on functionality
- Use a JSON array with objects with javascript
- Toggle show/hide on click with jQuery
- How does “/\s/g” replace spaces with other characters?
- What is the correct way to check for string equality in JavaScript?
- JavaScript TypeError: Cannot read property ‘style’ of null
- How to obtain username from Promise
? - How do you check if a variable is an array in JavaScript?
- ReferenceError : window is not defined at object.
Node.js - Node.js Port 3000 already in use but it actually isn’t?
- Uncaught TypeError: $.post is not a function
- Unable to verify leaf signature
- When and why to ‘return false’ in JavaScript?
- In angularjs we are having ng-disabled directive, why ng-enabled directive is not provided by the framework as we are having ng-show and ng-hide
- Send POST data using XMLHttpRequest
- querySelector vs. getElementById
- How to format numbers as currency strings
- Understanding how data-dismiss attribute works in Bootstrap
- Add table row in jQuery
- Node.js document is not defined
- Create table with jQuery – append
- When is JavaScript synchronous?
- How to reset a form using jQuery with .reset() method
- Permutations in JavaScript?
- How do I remove documents using Node.js Mongoose?
- node-request – Getting error “SSL23_GET_SERVER_HELLO:unknown protocol”
- Count the number of occurrences of a character in a string in Javascript
- Javascript removeEventListener not working
- Load image with jQuery and append it to the DOM
- javascript unexpected identifier
- How to send email by using javascript or jquery
- Access to Image from origin ‘null’ has been blocked by CORS policy
- Onclick on bootstrap button
- TypeError: res.json is not a function
- How to do case insensitive string comparison?
- Understanding the ngRepeat ‘track by’ expression
- How can I test if a letter in a string is uppercase or lowercase using JavaScript?
- JavaScript post request like a form submit
- Jest encountered an unexpected token
- How to get the first element of an array?
- How to enable CORS in AngularJs
- bootstrap buttons onclick events
- Cannot read property ‘forEach’ of undefined
- JavaScript: function returning an object
- What are the benefits of using wp_enqueue_script?
- Is it Possible to Extend WP Customize JS Methods?
- Load multiple Javascript scripts
- WP script versioning breaks cross-site caching?
- Modify Custom Field in Media Library using JavaScript
- Modify the array of selected images in media modal
- How to set additional parameter in wp.media?
- How should I add JavaScript to a child theme?
- Create user from outside WordPress through api?
- Load plugin JS in footer
- Using wp_localize_script inside template page to transfer var from php to js
- How to disable inline css styles generated by Gutenberg editor?
- Multiple Conditional Controllers
- Adding javascript trigger to user role selection on the user-edit page
- Vue and wordpress.Bad Request ajax request
- How to add if lt IE9 conditional scripts to functions.php
- How to include a JSON file on my page?
- How to add “on change” to a text input in contact form7?
- Update media library attachments
- JavaScript Libraries in WordPress
- How to use WP switchEditors.switchto(this) JS function in your own script?
- Landing function through URL
- Escaping quotes while enqueuing scripts
- Combining results from WP-API using AngularJS
- Anyway to disable the auto excerpt creation?
- How do I cycle a JS function in WordPress? [closed]