Skip to content
Snippets Groups Projects
Select Git revision
  • 7f3c21ae9c100d5e4e231890a48faeef359f2860
  • noblogs default
  • noblogs-5.7.1
  • upstream
  • noblogs-5.7
  • noblogs-5.6new
  • upstream5.5.1
  • noblogs28dic
  • upstream28dic
  • noblogs-5.5.1
  • noblogs-5.4.2
  • noblogs-5.4_seconda
  • noblogs-5.4
  • noblogs-7c
  • wp5.2.3p3
  • mergedbconf
  • noblogs-5.7.1
  • noblogs.5.7.0p1
  • noblogs-5.7.0
  • noblogs-5.6p3
  • noblogs5.6p2
  • noblogs-5.6p1
  • noblogs-5.6
  • noblogs-5.4.2p1
  • noblogs-5.4.2
  • noblogs-5.4.1
  • noblogs-5.4
  • noblogs-p5.4
  • noblogs-5.3.2p2
  • noblogs-5.3.2p1
  • noblogs-5.3.2
  • noblogs-5.3
  • noblogs-5.2.3p4
  • noblogs-5.2.3p3
  • noblogs-5.2.3p2
  • noblogs-5.2.3p1
36 results

disable-core-update.php

Blame
  • wp-api.js 45.61 KiB
    (function( window, undefined ) {
    
    	'use strict';
    
    	/**
    	 * Initialise the WP_API.
    	 */
    	function WP_API() {
    		/** @namespace wp.api.models */
    		this.models = {};
    		/** @namespace wp.api.collections */
    		this.collections = {};
    		/** @namespace wp.api.views */
    		this.views = {};
    	}
    
    	/** @namespace wp */
    	window.wp            = window.wp || {};
    	/** @namespace wp.api */
    	wp.api               = wp.api || new WP_API();
    	wp.api.versionString = wp.api.versionString || 'wp/v2/';
    
    	// Alias _includes to _.contains, ensuring it is available if lodash is used.
    	if ( ! _.isFunction( _.includes ) && _.isFunction( _.contains ) ) {
    	  _.includes = _.contains;
    	}
    
    })( window );
    
    (function( window, undefined ) {
    
    	'use strict';
    
    	var pad, r;
    
    	/** @namespace wp */
    	window.wp = window.wp || {};
    	/** @namespace wp.api */
    	wp.api = wp.api || {};
    	/** @namespace wp.api.utils */
    	wp.api.utils = wp.api.utils || {};
    
    	/**
    	 * Determine model based on API route.
    	 *
    	 * @param {string} route    The API route.
    	 *
    	 * @return {Backbone Model} The model found at given route. Undefined if not found.
    	 */
    	wp.api.getModelByRoute = function( route ) {
    		return _.find( wp.api.models, function( model ) {
    			return model.prototype.route && route === model.prototype.route.index;
    		} );
    	};
    
    	/**
    	 * Determine collection based on API route.
    	 *
    	 * @param {string} route    The API route.
    	 *
    	 * @return {Backbone Model} The collection found at given route. Undefined if not found.
    	 */
    	wp.api.getCollectionByRoute = function( route ) {
    		return _.find( wp.api.collections, function( collection ) {
    			return collection.prototype.route && route === collection.prototype.route.index;
    		} );
    	};
    
    
    	/**