[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/ -> script-loader.php (summary)

WordPress scripts and styles default loader. Several constants are used to manage the loading, concatenating and compression of scripts and CSS: define('SCRIPT_DEBUG', true); loads the development (non-minified) versions of all scripts and CSS, and disables compression and concatenation, define('CONCATENATE_SCRIPTS', false); disables compression and concatenation of scripts and CSS, define('COMPRESS_SCRIPTS', false); disables compression of scripts, define('COMPRESS_CSS', false); disables compression of CSS, define('ENFORCE_GZIP', true); forces gzip for compression (default is deflate).

File Size: 2833 lines (112 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 7 files
 wp-includes/functions.wp-scripts.php
 wp-includes/class.wp-scripts.php
 wp-includes/version.php
 wp-includes/class.wp-styles.php
 wp-includes/class-wp-dependency.php
 wp-includes/functions.wp-styles.php
 wp-includes/class.wp-dependencies.php

Defines 30 functions

  wp_register_tinymce_scripts()
  wp_default_packages_vendor()
  wp_get_script_polyfill()
  wp_default_packages_scripts()
  wp_default_packages_inline_scripts()
  wp_tinymce_inline_scripts()
  wp_default_packages()
  wp_scripts_get_suffix()
  wp_default_scripts()
  wp_default_styles()
  wp_prototype_before_jquery()
  wp_just_in_time_script_localization()
  wp_localize_jquery_ui_datepicker()
  wp_localize_community_events()
  wp_style_loader_src()
  print_head_scripts()
  print_footer_scripts()
  _print_scripts()
  wp_print_head_scripts()
  _wp_footer_scripts()
  wp_print_footer_scripts()
  wp_enqueue_scripts()
  print_admin_styles()
  print_late_styles()
  _print_styles()
  script_concat_settings()
  wp_common_block_scripts_and_styles()
  wp_enqueue_registered_block_scripts_and_styles()
  enqueue_block_styles_assets()
  enqueue_editor_block_styles_assets()

Functions
Functions that are not part of a class:

wp_register_tinymce_scripts( &$scripts, $force_uncompressed = false )   X-Ref
Registers TinyMCE scripts.

since: 5.0.0
param: WP_Scripts $scripts WP_Scripts object.

wp_default_packages_vendor( &$scripts )   X-Ref
Registers all the WordPress vendor scripts that are in the standardized
`js/dist/vendor/` location.

For the order of `$scripts->add` see `wp_default_scripts`.

since: 5.0.0
param: WP_Scripts $scripts WP_Scripts object.

wp_get_script_polyfill( &$scripts, $tests )   X-Ref
Returns contents of an inline script used in appending polyfill scripts for
browsers which fail the provided tests. The provided array is a mapping from
a condition to verify feature support to its polyfill script handle.

return: string Conditional polyfill inline script.
since: 5.0.0
param: WP_Scripts $scripts WP_Scripts object.
param: array      $tests   Features to detect.

wp_default_packages_scripts( &$scripts )   X-Ref
Registers all the WordPress packages scripts that are in the standardized
`js/dist/` location.

For the order of `$scripts->add` see `wp_default_scripts`.

since: 5.0.0
param: WP_Scripts $scripts WP_Scripts object.

wp_default_packages_inline_scripts( &$scripts )   X-Ref
Adds inline scripts required for the WordPress JavaScript packages.

since: 5.0.0
param: WP_Scripts $scripts WP_Scripts object.

wp_tinymce_inline_scripts()   X-Ref
Adds inline scripts required for the TinyMCE in the block editor.

These TinyMCE init settings are used to extend and override the default settings
from `_WP_Editors::default_settings()` for the Classic block.

since: 5.0.0

wp_default_packages( &$scripts )   X-Ref
Registers all the WordPress packages scripts.

since: 5.0.0
param: WP_Scripts $scripts WP_Scripts object.

wp_scripts_get_suffix( $type = '' )   X-Ref
Returns the suffix that can be used for the scripts.

There are two suffix types, the normal one and the dev suffix.

return: string The script suffix.
since: 5.0.0
param: string $type The type of suffix to retrieve.

wp_default_scripts( &$scripts )   X-Ref
Register all WordPress scripts.

Localizes some of them.
args order: `$scripts->add( 'handle', 'url', 'dependencies', 'query-string', 1 );`
when last arg === 1 queues the script for the footer

since: 2.6.0
param: WP_Scripts $scripts WP_Scripts object.

wp_default_styles( &$styles )   X-Ref
Assign default styles to $styles object.

Nothing is returned, because the $styles parameter is passed by reference.
Meaning that whatever object is passed will be updated without having to
reassign the variable that was passed back to the same value. This saves
memory.

Adding default styles is not the only task, it also assigns the base_url
property, the default version, and text direction for the object.

since: 2.6.0
param: WP_Styles $styles

wp_prototype_before_jquery( $js_array )   X-Ref
Reorder JavaScript scripts array to place prototype before jQuery.

return: array Reordered array, if needed.
since: 2.3.1
param: array $js_array JavaScript scripts array

wp_just_in_time_script_localization()   X-Ref
Load localized data on print rather than initialization.

These localizations require information that may not be loaded even by init.

since: 2.5.0

wp_localize_jquery_ui_datepicker()   X-Ref
Localizes the jQuery UI datepicker.

since: 4.6.0

wp_localize_community_events()   X-Ref
Localizes community events data that needs to be passed to dashboard.js.

since: 4.8.0

wp_style_loader_src( $src, $handle )   X-Ref
Administration Screen CSS for changing the styles.

If installing the 'wp-admin/' directory will be replaced with './'.

The $_wp_admin_css_colors global manages the Administration Screens CSS
stylesheet that is loaded. The option that is set is 'admin_color' and is the
color and key for the array. The value for the color key is an object with
a 'url' parameter that has the URL path to the CSS file.

The query from $src parameter will be appended to the URL that is given from
the $_wp_admin_css_colors array value URL.

return: string|false URL path to CSS stylesheet for Administration Screens.
since: 2.6.0
param: string $src    Source URL.
param: string $handle Either 'colors' or 'colors-rtl'.

print_head_scripts()   X-Ref
Prints the script queue in the HTML head on admin pages.

Postpones the scripts that were queued for the footer.
print_footer_scripts() is called in the footer to print these scripts.

return: array
since: 2.8.0

print_footer_scripts()   X-Ref
Prints the scripts that were queued for the footer or too late for the HTML head.

return: array
since: 2.8.0

_print_scripts()   X-Ref
Print scripts (internal use only)


wp_print_head_scripts()   X-Ref
Prints the script queue in the HTML head on the front end.

Postpones the scripts that were queued for the footer.
wp_print_footer_scripts() is called in the footer to print these scripts.

return: array
since: 2.8.0

_wp_footer_scripts()   X-Ref
Private, for use in *_footer_scripts hooks

since: 3.3.0

wp_print_footer_scripts()   X-Ref
Hooks to print the scripts and styles in the footer.

since: 2.8.0

wp_enqueue_scripts()   X-Ref
Wrapper for do_action('wp_enqueue_scripts')

Allows plugins to queue scripts for the front end using wp_enqueue_script().
Runs first in wp_head() where all is_home(), is_page(), etc. functions are available.

since: 2.8.0

print_admin_styles()   X-Ref
Prints the styles queue in the HTML head on admin pages.

return: array
since: 2.8.0

print_late_styles()   X-Ref
Prints the styles that were queued too late for the HTML head.

return: array|void
since: 3.3.0

_print_styles()   X-Ref
Print styles (internal use only)

since: 3.3.0

script_concat_settings()   X-Ref
Determine the concatenation and compression settings for scripts and styles.

since: 2.8.0

wp_common_block_scripts_and_styles()   X-Ref
Handles the enqueueing of block scripts and styles that are common to both
the editor and the front-end.

since: 5.0.0

wp_enqueue_registered_block_scripts_and_styles()   X-Ref
Enqueues registered block scripts and styles, depending on current rendered
context (only enqueuing editor scripts while in context of the editor).

since: 5.0.0

enqueue_block_styles_assets()   X-Ref
Function responsible for enqueuing the styles required for block styles functionality on the editor and on the frontend.

since: 5.3.0

enqueue_editor_block_styles_assets()   X-Ref
Function responsible for enqueuing the assets required for block styles functionality on the editor.

since: 5.3.0



Generated: Sun Sep 15 01:00:03 2019 Cross-referenced by PHPXref 0.7.1