at path:ROOT / wp-includes / js / wp-util.js
run:R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:51
R W Run
10.3 KB
2026-03-11 16:18:51
R W Run
3.41 KB
2026-03-11 16:18:51
R W Run
3.25 KB
2026-03-11 16:18:51
R W Run
1023 By
2026-03-11 16:18:51
R W Run
21.95 KB
2026-03-11 16:18:51
R W Run
5.67 KB
2026-03-11 16:18:51
R W Run
78.51 KB
2026-03-11 16:18:51
R W Run
23.73 KB
2026-03-11 16:18:51
R W Run
26.18 KB
2026-03-11 16:18:51
R W Run
8.8 KB
2026-03-11 16:18:51
R W Run
28.4 KB
2026-03-11 16:18:51
R W Run
16.11 KB
2026-03-11 16:18:51
R W Run
12.22 KB
2026-03-11 16:18:51
R W Run
2.96 KB
2026-03-11 16:18:51
R W Run
25.22 KB
2026-03-11 16:18:51
R W Run
7.67 KB
2026-03-11 16:18:51
R W Run
7.72 KB
2026-03-11 16:18:51
R W Run
3.47 KB
2026-03-11 16:18:51
R W Run
6.66 KB
2026-03-11 16:18:51
R W Run
3.59 KB
2026-03-11 16:18:51
R W Run
14.67 KB
2026-03-11 16:18:51
R W Run
4.92 KB
2026-03-11 16:18:51
R W Run
22.71 KB
2026-03-11 16:18:51
R W Run
7.64 KB
2026-03-11 16:18:51
R W Run
27.93 KB
2026-03-11 16:18:51
R W Run
10.75 KB
2026-03-11 16:18:51
R W Run
32.55 KB
2026-03-11 16:18:51
R W Run
10.44 KB
2026-03-11 16:18:51
R W Run
5.1 KB
2026-03-11 16:18:51
R W Run
2.51 KB
2026-03-11 16:18:51
R W Run
23.49 KB
2026-03-11 16:18:51
R W Run
5.81 KB
2026-03-11 16:18:51
R W Run
7.06 KB
2026-03-11 16:18:51
R W Run
1.46 KB
2026-03-11 16:18:51
R W Run
1.68 KB
2026-03-11 16:18:51
R W Run
5.39 KB
2026-03-11 16:18:51
R W Run
31 By
2026-03-11 16:18:51
R W Run
35 By
2026-03-11 16:18:51
R W Run
23.57 KB
2026-03-11 16:18:51
R W Run
25.24 KB
2026-03-11 16:18:51
R W Run
9.54 KB
2026-03-11 16:18:51
R W Run
24.24 KB
2026-03-11 16:18:51
R W Run
11.77 KB
2026-03-11 16:18:51
R W Run
28.44 KB
2026-03-11 16:18:51
R W Run
10.63 KB
2026-03-11 16:18:51
R W Run
26.15 KB
2026-03-11 16:18:51
R W Run
12.98 KB
2026-03-11 16:18:51
R W Run
42.58 KB
2026-03-11 16:18:51
R W Run
12.97 KB
2026-03-11 16:18:51
R W Run
266.99 KB
2026-03-11 16:18:51
R W Run
108.18 KB
2026-03-11 16:18:51
R W Run
22.07 KB
2026-03-11 16:18:51
R W Run
10.87 KB
2026-03-11 16:18:51
R W Run
10.51 KB
2026-03-11 16:18:51
R W Run
2.58 KB
2026-03-11 16:18:51
R W Run
0 By
2026-03-11 16:18:51
R W Run
35 By
2026-03-11 16:18:51
R W Run
4.85 KB
2026-03-11 16:18:51
R W Run
3.21 KB
2026-03-11 16:18:51
R W Run
36.32 KB
2026-03-11 16:18:51
R W Run
19.39 KB
2026-03-11 16:18:51
R W Run
67.12 KB
2026-03-11 16:18:51
R W Run
18.46 KB
2026-03-11 16:18:51
R W Run
4.56 KB
2026-03-11 16:18:51
R W Run
1.82 KB
2026-03-11 16:18:51
R W Run
3.81 KB
2026-03-11 16:18:51
R W Run
2.51 KB
2026-03-11 16:18:51
R W Run
45.88 KB
2026-03-11 16:18:51
R W Run
14.34 KB
2026-03-11 16:18:51
R W Run
4.11 KB
2026-03-11 16:18:51
R W Run
1.62 KB
2026-03-11 16:18:51
R W Run
14.88 KB
2026-03-11 16:18:51
R W Run
2.97 KB
2026-03-11 16:18:51
R W Run
10.22 KB
2026-03-11 16:18:51
R W Run
4.34 KB
2026-03-11 16:18:51
R W Run
6.62 KB
2026-03-11 16:18:51
R W Run
3.1 KB
2026-03-11 16:18:51
R W Run
3.14 KB
2026-03-11 16:18:51
R W Run
1.22 KB
2026-03-11 16:18:51
R W Run
12.89 KB
2026-03-11 16:18:51
R W Run
2.82 KB
2026-03-11 16:18:51
R W Run
22.23 KB
2026-03-11 16:18:51
R W Run
8.59 KB
2026-03-11 16:18:51
R W Run
2.79 KB
2026-03-11 16:18:51
R W Run
970 By
2026-03-11 16:18:51
R W Run
597 By
2026-03-11 16:18:51
R W Run
24.72 KB
2026-03-11 16:18:51
R W Run
7.34 KB
2026-03-11 16:18:51
R W Run
9.99 KB
2026-03-11 16:18:51
R W Run
3.54 KB
2026-03-11 16:18:51
R W Run
1.3 KB
2026-03-11 16:18:51
R W Run
444 By
2026-03-11 16:18:51
R W Run
4.58 KB
2026-03-11 16:18:51
R W Run
1.4 KB
2026-03-11 16:18:51
R W Run
569 By
2026-03-11 16:18:51
R W Run
281 By
2026-03-11 16:18:51
R W Run
20.74 KB
2026-03-11 16:18:51
R W Run
11.05 KB
2026-03-11 16:18:51
R W Run
821 By
2026-03-11 16:18:51
R W Run
351 By
2026-03-11 16:18:51
R W Run
802.97 KB
2026-03-11 16:18:51
R W Run
error_log
📄wp-util.js
1/**
2 * @output wp-includes/js/wp-util.js
3 */
4
5/* global _wpUtilSettings */
6
7/** @namespace wp */
8window.wp = window.wp || {};
9
10(function ($) {
11 // Check for the utility settings.
12 var settings = typeof _wpUtilSettings === 'undefined' ? {} : _wpUtilSettings;
13
14 /**
15 * wp.template( id )
16 *
17 * Fetch a JavaScript template for an id, and return a templating function for it.
18 *
19 * @param {string} id A string that corresponds to a DOM element with an id prefixed with "tmpl-".
20 * For example, "attachment" maps to "tmpl-attachment".
21 * @return {function} A function that lazily-compiles the template requested.
22 */
23 wp.template = _.memoize(function ( id ) {
24 var compiled,
25 /*
26 * Underscore's default ERB-style templates are incompatible with PHP
27 * when asp_tags is enabled, so WordPress uses Mustache-inspired templating syntax.
28 *
29 * @see trac ticket #22344.
30 */
31 options = {
32 evaluate: /<#([\s\S]+?)#>/g,
33 interpolate: /\{\{\{([\s\S]+?)\}\}\}/g,
34 escape: /\{\{([^\}]+?)\}\}(?!\})/g,
35 variable: 'data'
36 };
37
38 return function ( data ) {
39 var el = document.querySelector( 'script#tmpl-' + id );
40 if ( ! el ) {
41 throw new Error( 'Template not found: ' + '#tmpl-' + id );
42 }
43 compiled = compiled || _.template( $( el ).html(), options );
44 return compiled( data );
45 };
46 });
47
48 /*
49 * wp.ajax
50 * ------
51 *
52 * Tools for sending ajax requests with JSON responses and built in error handling.
53 * Mirrors and wraps jQuery's ajax APIs.
54 */
55 wp.ajax = {
56 settings: settings.ajax || {},
57
58 /**
59 * wp.ajax.post( [action], [data] )
60 *
61 * Sends a POST request to WordPress.
62 *
63 * @param {(string|Object)} action The slug of the action to fire in WordPress or options passed
64 * to jQuery.ajax.
65 * @param {Object=} data Optional. The data to populate $_POST with.
66 * @return {$.promise} A jQuery promise that represents the request,
67 * decorated with an abort() method.
68 */
69 post: function( action, data ) {
70 return wp.ajax.send({
71 data: _.isObject( action ) ? action : _.extend( data || {}, { action: action })
72 });
73 },
74
75 /**
76 * wp.ajax.send( [action], [options] )
77 *
78 * Sends a POST request to WordPress.
79 *
80 * @param {(string|Object)} action The slug of the action to fire in WordPress or options passed
81 * to jQuery.ajax.
82 * @param {Object=} options Optional. The options passed to jQuery.ajax.
83 * @return {$.promise} A jQuery promise that represents the request,
84 * decorated with an abort() method.
85 */
86 send: function( action, options ) {
87 var promise, deferred;
88 if ( _.isObject( action ) ) {
89 options = action;
90 } else {
91 options = options || {};
92 options.data = _.extend( options.data || {}, { action: action });
93 }
94
95 options = _.defaults( options || {}, {
96 type: 'POST',
97 url: wp.ajax.settings.url,
98 context: this
99 });
100
101 deferred = $.Deferred( function( deferred ) {
102 // Transfer success/error callbacks.
103 if ( options.success ) {
104 deferred.done( options.success );
105 }
106
107 if ( options.error ) {
108 deferred.fail( options.error );
109 }
110
111 delete options.success;
112 delete options.error;
113
114 // Use with PHP's wp_send_json_success() and wp_send_json_error().
115 deferred.jqXHR = $.ajax( options ).done( function( response ) {
116 // Treat a response of 1 as successful for backward compatibility with existing handlers.
117 if ( response === '1' || response === 1 ) {
118 response = { success: true };
119 }
120
121 if ( _.isObject( response ) && ! _.isUndefined( response.success ) ) {
122
123 // When handling a media attachments request, get the total attachments from response headers.
124 var context = this;
125 deferred.done( function() {
126 if (
127 action &&
128 action.data &&
129 'query-attachments' === action.data.action &&
130 deferred.jqXHR.hasOwnProperty( 'getResponseHeader' ) &&
131 deferred.jqXHR.getResponseHeader( 'X-WP-Total' )
132 ) {
133 context.totalAttachments = parseInt( deferred.jqXHR.getResponseHeader( 'X-WP-Total' ), 10 );
134 } else {
135 context.totalAttachments = 0;
136 }
137 } );
138 deferred[ response.success ? 'resolveWith' : 'rejectWith' ]( this, [response.data] );
139 } else {
140 deferred.rejectWith( this, [response] );
141 }
142 }).fail( function() {
143 deferred.rejectWith( this, arguments );
144 });
145 });
146
147 promise = deferred.promise();
148 promise.abort = function() {
149 deferred.jqXHR.abort();
150 return this;
151 };
152
153 return promise;
154 }
155 };
156
157}(jQuery));
158