ꦆꦤ꧀ꦝꦿꦩꦪꦸꦲꦕ꧀ꦏꦺꦂꦠꦼꦄꦩ꧀
/
home
/
banildaco
/
public_html
/
wp-includes
/
Nama File / Folder
Size
Action
ID3
--
NONE
IXR
--
NONE
PHPMailer
--
NONE
Requests
--
NONE
SimplePie
--
NONE
Text
--
NONE
abilities-api
--
NONE
assets
--
NONE
block-bindings
--
NONE
block-patterns
--
NONE
block-supports
--
NONE
blocks
--
NONE
certificates
--
NONE
css
--
NONE
customize
--
NONE
fonts
--
NONE
html-api
--
NONE
images
--
NONE
interactivity-api
--
NONE
js
--
NONE
l10n
--
NONE
php-compat
--
NONE
pomo
--
NONE
rest-api
--
NONE
sitemaps
--
NONE
sodium_compat
--
NONE
style-engine
--
NONE
theme-compat
--
NONE
widgets
--
NONE
abilities-api.php
23.798KB
Hapus
Edit
Rename
abilities.php
7.796KB
Hapus
Edit
Rename
admin-bar.php
36.1KB
Hapus
Edit
Rename
atomlib.php
11.896KB
Hapus
Edit
Rename
author-template.php
18.937KB
Hapus
Edit
Rename
block-bindings.php
7.35KB
Hapus
Edit
Rename
block-i18n.json
0.309KB
Hapus
Edit
Rename
block-template-utils.php
61.02KB
Hapus
Edit
Rename
block-template.php
14.999KB
Hapus
Edit
Rename
blocks.php
112.05KB
Hapus
Edit
Rename
bookmark-template.php
12.469KB
Hapus
Edit
Rename
bookmark.php
15.065KB
Hapus
Edit
Rename
cache-compat.php
9.842KB
Hapus
Edit
Rename
cache.php
13.17KB
Hapus
Edit
Rename
canonical.php
33.833KB
Hapus
Edit
Rename
capabilities.php
42.629KB
Hapus
Edit
Rename
category-template.php
55.708KB
Hapus
Edit
Rename
category.php
12.528KB
Hapus
Edit
Rename
class-IXR.php
2.555KB
Hapus
Edit
Rename
class-avif-info.php
28.921KB
Hapus
Edit
Rename
class-feed.php
0.526KB
Hapus
Edit
Rename
class-http.php
0.358KB
Hapus
Edit
Rename
class-json.php
42.652KB
Hapus
Edit
Rename
class-oembed.php
0.392KB
Hapus
Edit
Rename
class-phpass.php
6.612KB
Hapus
Edit
Rename
class-phpmailer.php
0.648KB
Hapus
Edit
Rename
class-pop3.php
20.626KB
Hapus
Edit
Rename
class-requests.php
2.185KB
Hapus
Edit
Rename
class-simplepie.php
0.442KB
Hapus
Edit
Rename
class-smtp.php
0.446KB
Hapus
Edit
Rename
class-snoopy.php
36.831KB
Hapus
Edit
Rename
class-walker-category-dropdown.php
2.411KB
Hapus
Edit
Rename
class-walker-category.php
8.278KB
Hapus
Edit
Rename
class-walker-comment.php
13.888KB
Hapus
Edit
Rename
class-walker-nav-menu.php
11.762KB
Hapus
Edit
Rename
class-walker-page-dropdown.php
2.646KB
Hapus
Edit
Rename
class-walker-page.php
7.434KB
Hapus
Edit
Rename
class-wp-admin-bar.php
17.455KB
Hapus
Edit
Rename
class-wp-ajax-response.php
5.143KB
Hapus
Edit
Rename
class-wp-application-passwords.php
16.698KB
Hapus
Edit
Rename
class-wp-block-bindings-registry.php
8.283KB
Hapus
Edit
Rename
class-wp-block-bindings-source.php
2.922KB
Hapus
Edit
Rename
class-wp-block-editor-context.php
1.318KB
Hapus
Edit
Rename
class-wp-block-list.php
4.603KB
Hapus
Edit
Rename
class-wp-block-metadata-registry.php
11.616KB
Hapus
Edit
Rename
class-wp-block-parser-block.php
2.495KB
Hapus
Edit
Rename
class-wp-block-parser-frame.php
1.97KB
Hapus
Edit
Rename
class-wp-block-pattern-categories-registry.php
5.322KB
Hapus
Edit
Rename
class-wp-block-patterns-registry.php
10.597KB
Hapus
Edit
Rename
class-wp-block-processor.php
68.319KB
Hapus
Edit
Rename
class-wp-block-styles-registry.php
6.345KB
Hapus
Edit
Rename
class-wp-block-supports.php
5.494KB
Hapus
Edit
Rename
class-wp-block-template.php
1.985KB
Hapus
Edit
Rename
class-wp-block-templates-registry.php
7.024KB
Hapus
Edit
Rename
class-wp-block-type-registry.php
4.912KB
Hapus
Edit
Rename
class-wp-block-type.php
16.86KB
Hapus
Edit
Rename
class-wp-block.php
24.23KB
Hapus
Edit
Rename
class-wp-classic-to-block-menu-converter.php
3.975KB
Hapus
Edit
Rename
class-wp-comment-query.php
47.66KB
Hapus
Edit
Rename
class-wp-comment.php
9.216KB
Hapus
Edit
Rename
class-wp-customize-control.php
25.507KB
Hapus
Edit
Rename
class-wp-customize-manager.php
198.378KB
Hapus
Edit
Rename
class-wp-customize-nav-menus.php
56.653KB
Hapus
Edit
Rename
class-wp-customize-panel.php
10.459KB
Hapus
Edit
Rename
class-wp-customize-section.php
10.946KB
Hapus
Edit
Rename
class-wp-customize-setting.php
29.26KB
Hapus
Edit
Rename
class-wp-customize-widgets.php
70.905KB
Hapus
Edit
Rename
class-wp-date-query.php
35.3KB
Hapus
Edit
Rename
class-wp-dependencies.php
16.605KB
Hapus
Edit
Rename
class-wp-dependency.php
2.571KB
Hapus
Edit
Rename
class-wp-duotone.php
39.827KB
Hapus
Edit
Rename
class-wp-embed.php
15.558KB
Hapus
Edit
Rename
class-wp-exception.php
0.247KB
Hapus
Edit
Rename
class-wp-fatal-error-handler.php
7.959KB
Hapus
Edit
Rename
class-wp-feed-cache-transient.php
3.227KB
Hapus
Edit
Rename
class-wp-feed-cache.php
0.946KB
Hapus
Edit
Rename
class-wp-hook.php
16.283KB
Hapus
Edit
Rename
class-wp-http-cookie.php
7.216KB
Hapus
Edit
Rename
class-wp-http-curl.php
12.95KB
Hapus
Edit
Rename
class-wp-http-encoding.php
6.532KB
Hapus
Edit
Rename
class-wp-http-ixr-client.php
3.419KB
Hapus
Edit
Rename
class-wp-http-proxy.php
5.84KB
Hapus
Edit
Rename
class-wp-http-requests-hooks.php
1.975KB
Hapus
Edit
Rename
class-wp-http-requests-response.php
4.297KB
Hapus
Edit
Rename
class-wp-http-response.php
2.907KB
Hapus
Edit
Rename
class-wp-http-streams.php
16.464KB
Hapus
Edit
Rename
class-wp-image-editor-gd.php
20.22KB
Hapus
Edit
Rename
class-wp-image-editor-imagick.php
36.11KB
Hapus
Edit
Rename
class-wp-image-editor.php
17.007KB
Hapus
Edit
Rename
class-wp-list-util.php
7.269KB
Hapus
Edit
Rename
class-wp-locale-switcher.php
6.617KB
Hapus
Edit
Rename
class-wp-locale.php
16.487KB
Hapus
Edit
Rename
class-wp-matchesmapregex.php
1.785KB
Hapus
Edit
Rename
class-wp-meta-query.php
29.817KB
Hapus
Edit
Rename
class-wp-metadata-lazyloader.php
6.673KB
Hapus
Edit
Rename
class-wp-navigation-fallback.php
8.978KB
Hapus
Edit
Rename
class-wp-network-query.php
19.421KB
Hapus
Edit
Rename
class-wp-network.php
12.008KB
Hapus
Edit
Rename
class-wp-object-cache.php
17.113KB
Hapus
Edit
Rename
class-wp-oembed.php
30.928KB
Hapus
Edit
Rename
class-wp-paused-extensions-storage.php
4.991KB
Hapus
Edit
Rename
class-wp-phpmailer.php
4.246KB
Hapus
Edit
Rename
class-wp-plugin-dependencies.php
24.722KB
Hapus
Edit
Rename
class-wp-post-type.php
29.961KB
Hapus
Edit
Rename
class-wp-post.php
6.339KB
Hapus
Edit
Rename
class-wp-query.php
159.906KB
Hapus
Edit
Rename
class-wp-recovery-mode-cookie-service.php
6.716KB
Hapus
Edit
Rename
class-wp-recovery-mode-email-service.php
10.921KB
Hapus
Edit
Rename
class-wp-recovery-mode-key-service.php
4.77KB
Hapus
Edit
Rename
class-wp-recovery-mode-link-service.php
3.382KB
Hapus
Edit
Rename
class-wp-recovery-mode.php
11.185KB
Hapus
Edit
Rename
class-wp-rewrite.php
62.194KB
Hapus
Edit
Rename
class-wp-role.php
2.464KB
Hapus
Edit
Rename
class-wp-roles.php
9.174KB
Hapus
Edit
Rename
class-wp-script-modules.php
32.146KB
Hapus
Edit
Rename
class-wp-scripts.php
34.047KB
Hapus
Edit
Rename
class-wp-session-tokens.php
7.147KB
Hapus
Edit
Rename
class-wp-simplepie-file.php
3.469KB
Hapus
Edit
Rename
class-wp-simplepie-sanitize-kses.php
1.865KB
Hapus
Edit
Rename
class-wp-site-query.php
30.913KB
Hapus
Edit
Rename
class-wp-site.php
7.292KB
Hapus
Edit
Rename
class-wp-speculation-rules.php
7.351KB
Hapus
Edit
Rename
class-wp-styles.php
12.542KB
Hapus
Edit
Rename
class-wp-tax-query.php
19.118KB
Hapus
Edit
Rename
class-wp-taxonomy.php
18.124KB
Hapus
Edit
Rename
class-wp-term-query.php
39.993KB
Hapus
Edit
Rename
class-wp-term.php
5.174KB
Hapus
Edit
Rename
class-wp-text-diff-renderer-inline.php
0.956KB
Hapus
Edit
Rename
class-wp-text-diff-renderer-table.php
18.438KB
Hapus
Edit
Rename
class-wp-textdomain-registry.php
10.235KB
Hapus
Edit
Rename
class-wp-theme-json-data.php
1.767KB
Hapus
Edit
Rename
class-wp-theme-json-resolver.php
34.9KB
Hapus
Edit
Rename
class-wp-theme-json-schema.php
7.194KB
Hapus
Edit
Rename
class-wp-theme-json.php
160.495KB
Hapus
Edit
Rename
class-wp-theme.php
64.268KB
Hapus
Edit
Rename
class-wp-token-map.php
27.947KB
Hapus
Edit
Rename
class-wp-url-pattern-prefixer.php
4.689KB
Hapus
Edit
Rename
class-wp-user-meta-session-tokens.php
2.94KB
Hapus
Edit
Rename
class-wp-user-query.php
43.131KB
Hapus
Edit
Rename
class-wp-user-request.php
2.251KB
Hapus
Edit
Rename
class-wp-user.php
22.504KB
Hapus
Edit
Rename
class-wp-walker.php
13.01KB
Hapus
Edit
Rename
class-wp-widget-factory.php
3.269KB
Hapus
Edit
Rename
class-wp-xmlrpc-server.php
210.397KB
Hapus
Edit
Rename
class-wp.php
25.86KB
Hapus
Edit
Rename
class-wpdb.php
115.847KB
Hapus
Edit
Rename
class.wp-dependencies.php
0.364KB
Hapus
Edit
Rename
class.wp-scripts.php
0.335KB
Hapus
Edit
Rename
class.wp-styles.php
0.33KB
Hapus
Edit
Rename
comment-template.php
100.728KB
Hapus
Edit
Rename
comment.php
130.927KB
Hapus
Edit
Rename
compat-utf8.php
19.096KB
Hapus
Edit
Rename
compat.php
17.412KB
Hapus
Edit
Rename
cron.php
41.98KB
Hapus
Edit
Rename
date.php
0.391KB
Hapus
Edit
Rename
default-constants.php
11.099KB
Hapus
Edit
Rename
default-filters.php
37.021KB
Hapus
Edit
Rename
default-widgets.php
2.241KB
Hapus
Edit
Rename
deprecated.php
188.129KB
Hapus
Edit
Rename
embed-template.php
0.33KB
Hapus
Edit
Rename
embed.php
37.999KB
Hapus
Edit
Rename
error-protection.php
4.024KB
Hapus
Edit
Rename
error_log
186.633KB
Hapus
Edit
Rename
feed-atom-comments.php
5.375KB
Hapus
Edit
Rename
feed-atom.php
3.048KB
Hapus
Edit
Rename
feed-rdf.php
2.605KB
Hapus
Edit
Rename
feed-rss.php
1.161KB
Hapus
Edit
Rename
feed-rss2-comments.php
4.039KB
Hapus
Edit
Rename
feed-rss2.php
3.71KB
Hapus
Edit
Rename
feed.php
24.599KB
Hapus
Edit
Rename
fonts.php
9.561KB
Hapus
Edit
Rename
formatting.php
346.427KB
Hapus
Edit
Rename
functions.php
281.836KB
Hapus
Edit
Rename
functions.wp-scripts.php
14.952KB
Hapus
Edit
Rename
functions.wp-styles.php
8.438KB
Hapus
Edit
Rename
general-template.php
168.949KB
Hapus
Edit
Rename
global-styles-and-settings.php
20.707KB
Hapus
Edit
Rename
https-detection.php
5.72KB
Hapus
Edit
Rename
https-migration.php
4.63KB
Hapus
Edit
Rename
kses.php
81.716KB
Hapus
Edit
Rename
l10n.php
67.185KB
Hapus
Edit
Rename
link-template.php
156.364KB
Hapus
Edit
Rename
load.php
55.186KB
Hapus
Edit
Rename
locale.php
0.158KB
Hapus
Edit
Rename
media-template.php
61.716KB
Hapus
Edit
Rename
media.php
216.002KB
Hapus
Edit
Rename
meta.php
64.996KB
Hapus
Edit
Rename
ms-blogs.php
25.239KB
Hapus
Edit
Rename
ms-default-constants.php
4.806KB
Hapus
Edit
Rename
ms-default-filters.php
6.48KB
Hapus
Edit
Rename
ms-deprecated.php
21.249KB
Hapus
Edit
Rename
ms-files.php
2.79KB
Hapus
Edit
Rename
ms-functions.php
89.689KB
Hapus
Edit
Rename
ms-load.php
19.421KB
Hapus
Edit
Rename
ms-network.php
3.693KB
Hapus
Edit
Rename
ms-settings.php
4.105KB
Hapus
Edit
Rename
ms-site.php
40.739KB
Hapus
Edit
Rename
nav-menu-template.php
25.381KB
Hapus
Edit
Rename
nav-menu.php
43.333KB
Hapus
Edit
Rename
option.php
102.573KB
Hapus
Edit
Rename
pluggable-deprecated.php
6.176KB
Hapus
Edit
Rename
pluggable.php
124.47KB
Hapus
Edit
Rename
plugin.php
35.646KB
Hapus
Edit
Rename
post-formats.php
6.936KB
Hapus
Edit
Rename
post-template.php
67.039KB
Hapus
Edit
Rename
post-thumbnail-template.php
10.624KB
Hapus
Edit
Rename
post.php
289.133KB
Hapus
Edit
Rename
query.php
36.226KB
Hapus
Edit
Rename
registration-functions.php
0.195KB
Hapus
Edit
Rename
registration.php
0.195KB
Hapus
Edit
Rename
rest-api.php
98.295KB
Hapus
Edit
Rename
revision.php
30.021KB
Hapus
Edit
Rename
rewrite.php
19.033KB
Hapus
Edit
Rename
robots-template.php
5.063KB
Hapus
Edit
Rename
rss-functions.php
0.249KB
Hapus
Edit
Rename
rss.php
22.659KB
Hapus
Edit
Rename
script-loader.php
154.633KB
Hapus
Edit
Rename
script-modules.php
9.679KB
Hapus
Edit
Rename
session.php
0.252KB
Hapus
Edit
Rename
shortcodes.php
23.486KB
Hapus
Edit
Rename
sitemaps.php
3.162KB
Hapus
Edit
Rename
speculative-loading.php
8.398KB
Hapus
Edit
Rename
spl-autoload-compat.php
0.431KB
Hapus
Edit
Rename
style-engine.php
7.386KB
Hapus
Edit
Rename
taxonomy.php
172.908KB
Hapus
Edit
Rename
template-canvas.php
0.531KB
Hapus
Edit
Rename
template-loader.php
3.837KB
Hapus
Edit
Rename
template.php
35.971KB
Hapus
Edit
Rename
theme-i18n.json
1.689KB
Hapus
Edit
Rename
theme-previews.php
2.842KB
Hapus
Edit
Rename
theme-templates.php
6.092KB
Hapus
Edit
Rename
theme.json
8.712KB
Hapus
Edit
Rename
theme.php
131.844KB
Hapus
Edit
Rename
update.php
37.454KB
Hapus
Edit
Rename
user.php
173.889KB
Hapus
Edit
Rename
utf8.php
7.09KB
Hapus
Edit
Rename
vars.php
6.408KB
Hapus
Edit
Rename
version.php
1.08KB
Hapus
Edit
Rename
widgets.php
69.462KB
Hapus
Edit
Rename
wp-db.php
0.435KB
Hapus
Edit
Rename
wp-diff.php
0.78KB
Hapus
Edit
Rename
<=Back
<?php /** * Dependencies API: Scripts functions * * @since 2.6.0 * * @package WordPress * @subpackage Dependencies */ /** * Initializes $wp_scripts if it has not been set. * * @since 4.2.0 * * @global WP_Scripts $wp_scripts * * @return WP_Scripts WP_Scripts instance. */ function wp_scripts() { global $wp_scripts; if ( ! ( $wp_scripts instanceof WP_Scripts ) ) { $wp_scripts = new WP_Scripts(); } return $wp_scripts; } /** * Helper function to output a _doing_it_wrong message when applicable. * * @ignore * @since 4.2.0 * @since 5.5.0 Added the `$handle` parameter. * * @param string $function_name Function name. * @param string $handle Optional. Name of the script or stylesheet that was * registered or enqueued too early. Default empty. */ function _wp_scripts_maybe_doing_it_wrong( $function_name, $handle = '' ) { if ( did_action( 'init' ) || did_action( 'wp_enqueue_scripts' ) || did_action( 'admin_enqueue_scripts' ) || did_action( 'login_enqueue_scripts' ) ) { return; } $message = sprintf( /* translators: 1: wp_enqueue_scripts, 2: admin_enqueue_scripts, 3: login_enqueue_scripts */ __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ); if ( $handle ) { $message .= ' ' . sprintf( /* translators: %s: Name of the script or stylesheet. */ __( 'This notice was triggered by the %s handle.' ), '<code>' . $handle . '</code>' ); } _doing_it_wrong( $function_name, $message, '3.3.0' ); } /** * Prints scripts in document head that are in the $handles queue. * * Called by admin-header.php and {@see 'wp_head'} hook. Since it is called by wp_head on every page load, * the function does not instantiate the WP_Scripts object unless script names are explicitly passed. * Makes use of already-instantiated `$wp_scripts` global if present. Use provided {@see 'wp_print_scripts'} * hook to register/enqueue new scripts. * * @see WP_Scripts::do_item() * @since 2.1.0 * * @global WP_Scripts $wp_scripts The WP_Scripts object for printing scripts. * * @param string|string[]|false $handles Optional. Scripts to be printed. Default 'false'. * @return string[] On success, an array of handles of processed WP_Dependencies items; otherwise, an empty array. */ function wp_print_scripts( $handles = false ) { global $wp_scripts; /** * Fires before scripts in the $handles queue are printed. * * @since 2.1.0 */ do_action( 'wp_print_scripts' ); if ( '' === $handles ) { // For 'wp_head'. $handles = false; } _wp_scripts_maybe_doing_it_wrong( __FUNCTION__ ); if ( ! ( $wp_scripts instanceof WP_Scripts ) ) { if ( ! $handles ) { return array(); // No need to instantiate if nothing is there. } } return wp_scripts()->do_items( $handles ); } /** * Adds extra code to a registered script. * * Code will only be added if the script is already in the queue. * Accepts a string `$data` containing the code. If two or more code blocks * are added to the same script `$handle`, they will be printed in the order * they were added, i.e. the latter added code can redeclare the previous. * * @since 4.5.0 * * @see WP_Scripts::add_inline_script() * * @param string $handle Name of the script to add the inline script to. * @param string $data String containing the JavaScript to be added. * @param string $position Optional. Whether to add the inline script before the handle * or after. Default 'after'. * @return bool True on success, false on failure. */ function wp_add_inline_script( $handle, $data, $position = 'after' ) { _wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle ); if ( false !== stripos( $data, '</script>' ) ) { _doing_it_wrong( __FUNCTION__, sprintf( /* translators: 1: <script>, 2: wp_add_inline_script() */ __( 'Do not pass %1$s tags to %2$s.' ), '<code><script></code>', '<code>wp_add_inline_script()</code>' ), '4.5.0' ); $data = trim( preg_replace( '#<script[^>]*>(.*)</script>#is', '$1', $data ) ); } return wp_scripts()->add_inline_script( $handle, $data, $position ); } /** * Registers a new script. * * Registers a script to be enqueued later using the wp_enqueue_script() function. * * @see WP_Dependencies::add() * @see WP_Dependencies::add_data() * * @since 2.1.0 * @since 4.3.0 A return value was added. * @since 6.3.0 The $in_footer parameter of type boolean was overloaded to be an $args parameter of type array. * @since 6.9.0 The $fetchpriority parameter of type string was added to the $args parameter of type array. * * @param string $handle Name of the script. Should be unique. * @param string|false $src Full URL of the script, or path of the script relative to the WordPress root directory. * If source is set to false, script is an alias of other scripts it depends on. * @param string[] $deps Optional. An array of registered script handles this script depends on. Default empty array. * @param string|bool|null $ver Optional. String specifying script version number, if it has one, which is added to the URL * as a query string for cache busting purposes. If version is set to false, a version * number is automatically added equal to current installed WordPress version. * If set to null, no version is added. * @param array|bool $args { * Optional. An array of additional script loading strategies. Default empty array. * Otherwise, it may be a boolean in which case it determines whether the script is printed in the footer. Default false. * * @type string $strategy Optional. If provided, may be either 'defer' or 'async'. * @type bool $in_footer Optional. Whether to print the script in the footer. Default 'false'. * @type string $fetchpriority Optional. The fetch priority for the script. Default 'auto'. * } * @return bool Whether the script has been registered. True on success, false on failure. */ function wp_register_script( $handle, $src, $deps = array(), $ver = false, $args = array() ) { if ( ! is_array( $args ) ) { $args = array( 'in_footer' => (bool) $args, ); } _wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle ); $wp_scripts = wp_scripts(); $registered = $wp_scripts->add( $handle, $src, $deps, $ver ); if ( ! empty( $args['in_footer'] ) ) { $wp_scripts->add_data( $handle, 'group', 1 ); } if ( ! empty( $args['strategy'] ) ) { $wp_scripts->add_data( $handle, 'strategy', $args['strategy'] ); } if ( ! empty( $args['fetchpriority'] ) ) { $wp_scripts->add_data( $handle, 'fetchpriority', $args['fetchpriority'] ); } return $registered; } /** * Localizes a script. * * Works only if the script has already been registered. * * Accepts an associative array `$l10n` and creates a JavaScript object: * * "$object_name": { * key: value, * key: value, * ... * } * * @see WP_Scripts::localize() * @link https://core.trac.wordpress.org/ticket/11520 * * @since 2.2.0 * * @todo Documentation cleanup * * @param string $handle Script handle the data will be attached to. * @param string $object_name Name for the JavaScript object. Passed directly, so it should be qualified JS variable. * Example: '/[a-zA-Z0-9_]+/'. * @param array $l10n The data itself. The data can be either a single or multi-dimensional array. * @return bool True if the script was successfully localized, false otherwise. */ function wp_localize_script( $handle, $object_name, $l10n ) { $wp_scripts = wp_scripts(); return $wp_scripts->localize( $handle, $object_name, $l10n ); } /** * Sets translated strings for a script. * * Works only if the script has already been registered. * * @see WP_Scripts::set_translations() * @since 5.0.0 * @since 5.1.0 The `$domain` parameter was made optional. * * @global WP_Scripts $wp_scripts The WP_Scripts object for printing scripts. * * @param string $handle Script handle the textdomain will be attached to. * @param string $domain Optional. Text domain. Default 'default'. * @param string $path Optional. The full file path to the directory containing translation files. * @return bool True if the text domain was successfully localized, false otherwise. */ function wp_set_script_translations( $handle, $domain = 'default', $path = '' ) { global $wp_scripts; if ( ! ( $wp_scripts instanceof WP_Scripts ) ) { _wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle ); return false; } return $wp_scripts->set_translations( $handle, $domain, $path ); } /** * Removes a registered script. * * Note: there are intentional safeguards in place to prevent critical admin scripts, * such as jQuery core, from being unregistered. * * @see WP_Dependencies::remove() * * @since 2.1.0 * * @global string $pagenow The filename of the current screen. * * @param string $handle Name of the script to be removed. */ function wp_deregister_script( $handle ) { global $pagenow; _wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle ); /** * Do not allow accidental or negligent de-registering of critical scripts in the admin. * Show minimal remorse if the correct hook is used. */ $current_filter = current_filter(); if ( ( is_admin() && 'admin_enqueue_scripts' !== $current_filter ) || ( 'wp-login.php' === $pagenow && 'login_enqueue_scripts' !== $current_filter ) ) { $not_allowed = array( 'jquery', 'jquery-core', 'jquery-migrate', 'jquery-ui-core', 'jquery-ui-accordion', 'jquery-ui-autocomplete', 'jquery-ui-button', 'jquery-ui-datepicker', 'jquery-ui-dialog', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-menu', 'jquery-ui-mouse', 'jquery-ui-position', 'jquery-ui-progressbar', 'jquery-ui-resizable', 'jquery-ui-selectable', 'jquery-ui-slider', 'jquery-ui-sortable', 'jquery-ui-spinner', 'jquery-ui-tabs', 'jquery-ui-tooltip', 'jquery-ui-widget', 'underscore', 'backbone', ); if ( in_array( $handle, $not_allowed, true ) ) { _doing_it_wrong( __FUNCTION__, sprintf( /* translators: 1: Script name, 2: wp_enqueue_scripts */ __( 'Do not deregister the %1$s script in the administration area. To target the front-end theme, use the %2$s hook.' ), "<code>$handle</code>", '<code>wp_enqueue_scripts</code>' ), '3.6.0' ); return; } } wp_scripts()->remove( $handle ); } /** * Enqueues a script. * * Registers the script if `$src` provided (does NOT overwrite), and enqueues it. * * @see WP_Dependencies::add() * @see WP_Dependencies::add_data() * @see WP_Dependencies::enqueue() * * @since 2.1.0 * @since 6.3.0 The $in_footer parameter of type boolean was overloaded to be an $args parameter of type array. * @since 6.9.0 The $fetchpriority parameter of type string was added to the $args parameter of type array. * * @param string $handle Name of the script. Should be unique. * @param string $src Full URL of the script, or path of the script relative to the WordPress root directory. * Default empty. * @param string[] $deps Optional. An array of registered script handles this script depends on. Default empty array. * @param string|bool|null $ver Optional. String specifying script version number, if it has one, which is added to the URL * as a query string for cache busting purposes. If version is set to false, a version * number is automatically added equal to current installed WordPress version. * If set to null, no version is added. * @param array|bool $args { * Optional. An array of additional script loading strategies. Default empty array. * Otherwise, it may be a boolean in which case it determines whether the script is printed in the footer. Default false. * * @type string $strategy Optional. If provided, may be either 'defer' or 'async'. * @type bool $in_footer Optional. Whether to print the script in the footer. Default 'false'. * @type string $fetchpriority Optional. The fetch priority for the script. Default 'auto'. * } */ function wp_enqueue_script( $handle, $src = '', $deps = array(), $ver = false, $args = array() ) { _wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle ); $wp_scripts = wp_scripts(); if ( $src || ! empty( $args ) ) { $_handle = explode( '?', $handle ); if ( ! is_array( $args ) ) { $args = array( 'in_footer' => (bool) $args, ); } if ( $src ) { $wp_scripts->add( $_handle[0], $src, $deps, $ver ); } if ( ! empty( $args['in_footer'] ) ) { $wp_scripts->add_data( $_handle[0], 'group', 1 ); } if ( ! empty( $args['strategy'] ) ) { $wp_scripts->add_data( $_handle[0], 'strategy', $args['strategy'] ); } if ( ! empty( $args['fetchpriority'] ) ) { $wp_scripts->add_data( $_handle[0], 'fetchpriority', $args['fetchpriority'] ); } } $wp_scripts->enqueue( $handle ); } /** * Removes a previously enqueued script. * * @see WP_Dependencies::dequeue() * * @since 3.1.0 * * @param string $handle Name of the script to be removed. */ function wp_dequeue_script( $handle ) { _wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle ); wp_scripts()->dequeue( $handle ); } /** * Determines whether a script has been added to the queue. * * For more information on this and similar theme functions, check out * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ * Conditional Tags} article in the Theme Developer Handbook. * * @since 2.8.0 * @since 3.5.0 'enqueued' added as an alias of the 'queue' list. * * @param string $handle Name of the script. * @param string $status Optional. Status of the script to check. Default 'enqueued'. * Accepts 'enqueued', 'registered', 'queue', 'to_do', and 'done'. * @return bool Whether the script is queued. */ function wp_script_is( $handle, $status = 'enqueued' ) { _wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle ); return (bool) wp_scripts()->query( $handle, $status ); } /** * Adds metadata to a script. * * Works only if the script has already been registered. * * Possible values for $key and $value: * 'strategy' string 'defer' or 'async'. * * @since 4.2.0 * @since 6.9.0 Updated possible values to remove reference to 'conditional' and add 'strategy'. * * @see WP_Dependencies::add_data() * * @param string $handle Name of the script. * @param string $key Name of data point for which we're storing a value. * @param mixed $value String containing the data to be added. * @return bool True on success, false on failure. */ function wp_script_add_data( $handle, $key, $value ) { return wp_scripts()->add_data( $handle, $key, $value ); }
Liking