Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
wp_default_packages_scripts example
require
ABSPATH . 'wp-admin/includes/noop.php';
require
ABSPATH . WPINC . '/script-loader.php';
require
ABSPATH . WPINC . '/version.php';
$expires_offset
= 31536000; // 1 year.
$out
= '';
$wp_scripts
=
new
WP_Scripts
(
)
;
wp_default_scripts
(
$wp_scripts
)
;
wp_default_packages_vendor
(
$wp_scripts
)
;
wp_default_packages_scripts
(
$wp_scripts
)
;
if
(
isset
(
$_SERVER
[
'HTTP_IF_NONE_MATCH'
]
)
&&
stripslashes
(
$_SERVER
[
'HTTP_IF_NONE_MATCH'
]
)
===
$wp_version
)
{
header
(
"
$protocol
304 Not Modified"
)
;
exit
;
}
foreach
(
$load
as
$handle
)
{
if
(
!
array_key_exists
(
$handle
,
$wp_scripts
->registered
)
)
{
continue
;
}
/** * Registers all the WordPress packages scripts. * * @since 5.0.0 * * @param WP_Scripts $scripts WP_Scripts object. */
function
wp_default_packages
(
$scripts
)
{
wp_default_packages_vendor
(
$scripts
)
;
wp_register_development_scripts
(
$scripts
)
;
wp_register_tinymce_scripts
(
$scripts
)
;
wp_default_packages_scripts
(
$scripts
)
;
if
(
did_action
(
'init'
)
)
{
wp_default_packages_inline_scripts
(
$scripts
)
;
}
}
/** * Returns the suffix that can be used for the scripts. * * There are two suffix types, the normal one and the dev suffix. * * @since 5.0.0 * * @param string $type The type of suffix to retrieve. * @return string The script suffix. */