Backbone.js and WP API

I haven’t used the WP-API/JSON REST client plugin so far, but this is what I can see in source: The ~/js/models.js is the entry point for all requests, it seems. And every of the wp.api.models (to name a few: Page, Post, Media, Revision, etc.) is just an extension of Backbone.Model. And looking into the actual … Read more

How to Dequeue All WordPress Assets

I’m not sure what more you need that the example there, and remember that some scripts are needed for stuff like the admin bar and are not enqueued if you are not logged in. function wpdocs_dequeue_script() { wp_dequeue_script( ‘jquery-ui-core’ ); } add_action( ‘wp_print_scripts’, ‘wpdocs_dequeue_script’, 100 ); This will dequeue the jquery-ui-core js. Adding more lines … Read more

WP theme with Backbone

Well if you use Backbone with _s (https://github.com/tlovett1/_s_backbone) you will not be in problem. They used backbone for some effects and enqueuing is present still. /** * Enqueue scripts and styles. */ function _s_backbone_scripts() { wp_enqueue_style( ‘_s_backbone-style’, get_stylesheet_uri() ); wp_enqueue_script( ‘_s_backbone-navigation’, get_template_directory_uri() . ‘/js/navigation.js’, array(), ‘20120206’, true ); wp_enqueue_script( ‘_s_backbone-skip-link-focus-fix’, get_template_directory_uri() . ‘/js/skip-link-focus-fix.js’, array(), ‘20130115’, … Read more

Elegantly using JavaScript on widget admin forms

One way around this I’ve discovered since posting the above question is to instantiate inline via WP_Widget::form(), with wp_enqueue_script() loading the necessary JavaScript (exactly as mentioned above) — except, and here’s the key part, load the JavaScript in the header instead of the footer (fifth argument of wp_enqueue_script()). Which makes a lot of sense now … Read more

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