Check if user can in javascript
Check if user can in javascript
Check if user can in javascript
I found this answer, it can be done like this: const state = this.state(); const selection = state.get( ‘selection’ ); selection.add({ url: ‘http://www2.cnrs.fr/sites/communique/image/mona_unvarnish_web_image.jpg’ }); Where this is an instance of wp.media.view.MediaFrame.Select Hope it helps someone!
Maybe you have an image that was smaller or equal to the thumbnail size, if so, then no thumbnail will be created, and this.data[i].sizes.thumbnail will be undefined.
I can access the points using http requests to the external api, but I need to be able to access the full api inside of the react-wp-theme. You could use either the wp-api script / Backbone JavaScript client library or one of the other client libraries listed here such as the node-wpapi library. Using the … Read more
From the documentation: Backbone.sync is the function that Backbone calls every time it attempts to read or save a model to the server. By default, it uses jQuery.ajax to make a RESTful JSON request and returns a jqXHR. The sync function may be overridden globally as Backbone.sync, or at a finer-grained level, by adding a sync function to a Backbone collection or to an … Read more
No, you can’t, though I would rely on the Screen object, not the URL https://codex.wordpress.org/Function_Reference/get_current_screen
It was introduced in 3.5 for the media library, but it’s been periodically updated since then. Honestly, it’s been around long enough that you’re almost certainly using something else that has a more recent requirement.
Is there a media_upload_tabs-similar filter to add tabs to the simple/featured image picker?
Mapping Backbone Models to serialized array in wp_options table
How to submit data between wp_iframe and backbone.js in media upload