Pros and cons of using Backbone for WordPress theming [closed]

Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 8 years ago. Improve this question I’ve been noticing how Backbone seems to be the latest trend for WordPress theme development. A … Read more

Refreshing collections in the admin media manager

I know this question is very similar to this previously asked question; however, I was wondering if there was a more up-to-date/official way to refresh content programmatically in the WordPress admin media manager. In my specific instance, I’m trying to integrate the Getty Images plugin with a select attachment modal (e.g., Featured Image). Currently, I’ve … Read more

Add guid filter to attachment in media library grid mode

I’m trying to show in media modal box, attachments from a specific folder in my website and, correct me if I’m wrong, the best way to proceed is a like filter on wp_posts field GUID. Something like and ({$wpdb->posts}.guid LIKE ‘%/uploads_media_news/%’)). Problem is I don’t really know where to apply this filter: is it better … Read more

Is there a hook to process a backbone restful PUT request inside wordpress?

I play around with Backbone.js (Great !) and want to synchronize my model data with the wordpress ajax api (3.6.1) on the server-side. Adapted to this http://addyosmani.github.io/backbone-fundamentals/#restful-persistence, here is my backbone example: var new_posts; var post; (function($){ var Post = Backbone.Model.extend({ id: ”, title: ”, }); var Posts = Backbone.Collection.extend({ model: Post, url: APP.ajaxurl + … Read more

Rest API invalid nonce with Backbone Client

I’m using the built-in Backbone Client whenever I try to make a request it gives me this error: {“code”:”rest_cookie_invalid_nonce”,”message”:”Cookie nonce is invalid”,”data”:{“status”:403}} I read the Rest API Handbook – Authentication, and from what I’ve learned I don’t need to do any manual setting. Plugins in use: Askimet Anti-spam WP Fastest Cache iThemes WP Bannerize Yoast … Read more

Elegantly using JavaScript on widget admin forms

I’m working on a project involving a lot of widgets, and I’m thinking it’d be really great to have a “More options” section built using jQuery UI Accordion that expands when clicked. So, I’ve enqueued ‘jquery-ui-accordion’ using the ‘admin_enqueue_scripts’ action: function add_my_deps() { wp_enqueue_script(‘jquery-ui-accordion’); } add_action( ‘admin_enqueue_scripts’, ‘add_my_deps’ ); …And my JavaScript looks something like … Read more

What type of template are WP media-modal’s templates?

I was looking at the WordPress templates (html that’s written to the page instead of awkwardly adding strings in JS). There are a lot of templates like this in a post editor for example: <script type=”text/html” id=”tmpl-uploader-status-error”> <span class=”upload-error-filename”>{{{ data.filename }}}</span> <span class=”upload-error-message”>{{ data.message }}</span> </script> Now, I know these can be referenced with wp.media.template(‘uploader-status-error’)( … Read more