Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [backbone]

JavaScript library with models, collections and views. Requires Underscore.js or Lo-Dash.

1
vote
0answers
12 views

Setting/unsetting terms using the Backbone JavaScript client

I'd like to set and delete terms in my custom taxonomy using the WordPress Backbone JavaScript client, which provides access to the REST API in JavaScript. I can't find an example or suggestion in ...
0
votes
1answer
92 views

How to render WP Rest-API Endpoints in a React.js Theme with Woocommerce

I am building a Ecommerce Wordpress/Woocommerce Theme using React.js. I am using the npm package: create-react-wptheme This package renders the react app directly inside of the index.php of the ...
0
votes
1answer
36 views

Backbone event attachment:compat:ready can't hook

I want to ask question about events in backbone. I have problem to run some function when hook is triggerd. I want to wp.media.view.AttachmentCompat.prototype .on("attachment:compat:ready", ...
0
votes
1answer
133 views

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 ...
0
votes
0answers
63 views

Wordpress Media Uploader : How to add custom button on featured image tab

We are working on the plugin and try to add a custom button near 'set featured image' but we can not able to find out any solution or clue how to add it using media library function. Can someone ...
0
votes
1answer
39 views

Am I able to change the name of /wp-admin/options-general.php?

I'm asking this question because I am coding a Wordpress plugin, and I want to be able to detect when WP-Admin is using options-general.php. Currently, I'm just checking the URL directly to see if it ...
0
votes
1answer
30 views

Minimum version for Wordpress Backbone

How do I find the minimum Wordpress version required if I want to use Backbone on a plugin? I'm building a Wordpress plugin, and I can't find documentation online that records when Wordpress first ...
5
votes
2answers
5k views

How does REST API cookie authentication work in WP 4.7?

Though I have logged in, I cannot create a post on frontend. WordPress always return 401 Unauthorized response. I have dumped $_COOKIE to make sure logged-in cookie was set and got something like this:...
0
votes
1answer
211 views

Render repeatable widget fields properly with Backbone.js

I wanted to create widgets with repeatable fields for testimonials, time tables etc.. I recently stumbled up on this tutorial from codeable.io. I have some good experience with standard backbone.js ...
3
votes
2answers
3k views

Show only images and videos in a wp.media window

I'm using the following JS code to open a wp.media window to allow users to select images and videos for a gallery. Everything is working as expected, but I'm unable to restrict the window to show ...
2
votes
0answers
319 views

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 ...
2
votes
2answers
264 views

Is dynamic forms/entries possible in Widget?

I am new to WordPress Plugins development, and I just started working with the widget. My question is: What are the limitations of WordPress Widget? I tried to use jQuery to make the Widget Form more ...
1
vote
0answers
205 views

How to submit data between wp_iframe and backbone.js in media upload

In short: On a post/page edit.php I want to be able to click Add media and open the default media uploader instead of Create Gallery on the left-side menu there is a custom tab. on this custom ...
1
vote
0answers
28 views

Mapping Backbone Models to serialized array in wp_options table

I want to create a to do list to use Backbone in the context of WordPress, and i want to save models as single serialized array via update_option(), the problem is that i don't know how to mappe the ...
0
votes
2answers
782 views

How to Dequeue All WordPress Assets

I want to dequeue all styles and scripts that are loaded on the front-end (EG. not the admin panel) by default. I found this function, but am not sure how to utilize it to accomplish my goal. I'm ...
2
votes
1answer
239 views

WP theme with Backbone

What would be the best way to insure that a Backbone WP theme cooperates with standard shortcodes and other WP plugins that include script and style tags in header and footer. I know Backbone plays ...
5
votes
1answer
1k views

Open media frame and select an attachment

I'm using the following piece of code to open a media frame when clicking a link with a data-attachment_id attribute. This attribute holds the id of an attachment that I want to select when the frame ...
5
votes
1answer
395 views

Using the REST API (v2) javascript client on a private namespaced route

I am using the latest version of the REST API plugin in a project and I've added my routes to a separate namespace (as recommended in the documentation). The javascript client included with the API ...
1
vote
0answers
188 views

Is there a media_upload_tabs-similar filter to add tabs to the simple/featured image picker?

There's something I have been wondering about the media_upload_tabs filter that lets you create new image insert sections to the add-media modal in Wordpress editor inserter. Oddly enough it seems it ...
6
votes
1answer
949 views

Add custom class to attachment in media library grid mode

In the above screenshot we are in the media library with grid mode active. I want to add a custom class depending on the attachment filter wp_prepare_attachment_for_js. For example i hook to the ...
0
votes
1answer
340 views

WP-API + JS Backbone client - how to update post meta

Using the WP API and Backbone-based JS client, I'm trying to update a post's metadata as follows: var parentId = 96; // the post id var metaData = new wp.api.collections.PostMeta('', {parent: ...
2
votes
1answer
434 views

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 ...
0
votes
2answers
852 views

Hook into backbone to add js to wp-admin -> media library?

I've enqueued a .js file on the "Media Library" page (upload.php). I need to hide and manipulate a few of the thumbnails on the page using JS only ( I'm not looking for workarounds ). The elements ...
3
votes
0answers
202 views

How could I add button next to “edit image” button in “Attachment Details”

How could I add button next to "edit image" button in "Attachment Details" This is the location I would like to add button, Do you have any recommend?
9
votes
0answers
641 views

Modified wp.media.view.Settings.Gallery in Backbone JS, but editing doesn't work

I've added to the normal WordPress gallery popup (when clicking "Add Media" in the WordPress editor), in order to allow my custom gallery type to be selected (which interacts with / uses the main ...
2
votes
1answer
314 views

Adding fields to the media uploader with jquery listeners

So I have the code to successfully add a select field to my media uploader (gallery view) which is cool, but I also need to add some jquery listeners to that field. I'm using the '...
4
votes
1answer
588 views

Updating Post Meta with Backbone and the REST API

I'm getting started with a project that is making use of Backbone and the WP REST API, but I"m having a little trouble. Using the built in API JS for models and collections allows me to pretty easily ...
1
vote
1answer
523 views

How to check an ajax nonce in PHP

I'm modifying the media modal adding a new menu item to add external attachments to the media library. From the JS code I'm calling a PHP function that touches the database and accepts three ...
1
vote
1answer
343 views

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

I've created a media view template with two input fields (width and height) and I was wondering how to retrieve the values entered in them in a media controller o view. PHP: function ...
8
votes
0answers
789 views

How to trigger a refresh in the media modal

I'm developing a plugin that adds a new tab to the media modal, and I need to know a way trigger a refresh of the attachments tab so it shows newly added attachments. This is the code I'm using: wp....
3
votes
1answer
1k views

Switch to the library tab in the media uploader

I'm developing a plugin that adds a tab to the media uploader to add external videos to the media library via oembed. Everything works as expected but I need to switch to the library tab after adding ...
2
votes
0answers
354 views

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 ...
0
votes
1answer
701 views

i'm trying to get all my media query attachments via ajax in wordpress

i'm trying to load all my media files via ajax: $.ajax({ url: '/wp-admin/admin-ajax.php', type: 'post', data: { 'action': 'query-attachments', 'post_id': 0, ...
7
votes
1answer
705 views

Best approach when modifying the Media Manager

I am trying to edit the Media Manager to allow the selection of a new option in the "Link to" select field. This Backbone template is currently defined in media-template.php <label class="...
0
votes
0answers
208 views

WordPress integration with Backbone or AngularJS

I'm learning AngularJS, but I notice that a lot of people use Backbone when doing themes with WordPress. Is the decision based on personal preference? or are there parts of the WordPress API made to ...
1
vote
4answers
2k views

Backbone.js and WP API

I'm creating a theme based on the underscore theme with Backbone.js integration. I am struggling to find any clear examples/documentation on the WP-API plugin's capabilities, and starting to find it ...
0
votes
1answer
53 views

What does the “Show Images” do for Wordpress music playlist?

In the new audio playlist in Wordpress 3.9, you can check the options: Show Tracklist Show Artist Name in Tracklist Show Images The last option doesn't really make sense. There is no option to set ...
7
votes
1answer
1k views

How to hook in and modify the new revisions UI (3.6+)?

Let's say I want to add some post_meta into the "new" revisions UI. I'm saving some meta on revisions only, and want to display it on this screen. Normally, I'd open up wp-admin/revisions.php look ...
0
votes
0answers
781 views

Custom shortcode editor [BackboneJS & TinyMCE)

I'm using Wordpress 3.9.1 and I wrote a custom shortcode that working, but I'd like to custom it a little bit When I use my shortcode, this is the render in the admin page : [toggles title="zaez"]...
0
votes
1answer
654 views

Implementing backbone.js to retrieve category posts using JSON API

Note: I reformulated this post after solving my original problem because I immediately ran into another problem that can fit under the same title. First I'll summarize the first problem and my ...
5
votes
1answer
1k views

Customizing the 3.5 “Add Media” popup (Backbone.js)

Here's yet another question in regard to the new(ish) 3.5 "Add Media" popup and how to customize it! What I'm trying to do I'm attempting to do four main things: 1) Create a custom tab titled "...
2
votes
3answers
2k views

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 ...
8
votes
2answers
2k views

Using Backbone with the WordPress AJAX API

I'm attempting to build out a simple TODO plugin using Backbone and have run into an issue with the AJAX API. In order to get the correct AJAX call back you have to pass in the "action" parameter ...
2
votes
0answers
1k views

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

I've been noticing how Backbone seems to be the latest trend for WordPress theme development. A few data points: Backbone.js and WordPress development resources Theme Foundry's Collections theme. ...
7
votes
1answer
803 views

print_media_templates not applied in media manager plugin

I'm trying to build a media library where users can choose pictures that are being retrieved from custom folders, which they can specify the basefolder of. I am getting the correct images back, but ...
2
votes
1answer
591 views

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/...
12
votes
1answer
3k views

Add filter function in media modal box

I'm trying to extend the media modal, but I cant' find any documentation / tutorials about it. I'm not a master of backbone too ;-) I want to add a select box for each taxonomy that is attached to ...
32
votes
1answer
3k views

Pre populate WordPress wp_media modal with image selection

I'm the developer of the Advanced Custom Fields plugin and am hoping you can help me out with an issue I am facing. I have a button where you can edit an image. This button will launch a WP 3.5 media ...
6
votes
1answer
5k views

Display attachments by ID in a wp.media frame

I'm trying to use the new wp.media uploader frame for an app I'm building. I've read up a lot on other questions, blog posts, etc etc. The code I pasted below is working already quite fine and even ...
4
votes
1answer
2k views

Using Underscore Templates in WordPress

I've noticed that since WP 3.5 that we now have the Backbone.js and Underscore.js libraries included. The new Media Modal uses Underscore templates and I was wondering how would I be able to insert ...