wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
wp_default_packages_scripts › WordPress Function
Seit5.0.0
Veraltetn/v
› wp_default_packages_scripts ( $scripts )
Parameter: |
|
Definiert in: |
|
Codex: |
Registers all the WordPress packages scripts that are in the standardized `js/dist/` location.
For the order of $scripts->add
see wp_default_scripts
.
Ähnliche Funktionen: wp_default_packages_inline_scripts, wp_default_packages, wp_default_scripts, wp_default_packages_vendor, wp_dequeue_script
Quellcode
function wp_default_packages_scripts( &$scripts ) { $suffix = wp_scripts_get_suffix(); $packages_versions = array( 'api-fetch' => '2.2.8', 'a11y' => '2.0.2', 'annotations' => '1.0.8', 'autop' => '2.0.2', 'blob' => '2.1.0', 'block-library' => '2.2.16', 'block-serialization-default-parser' => '2.0.5', 'blocks' => '6.0.6', 'components' => '7.0.8', 'compose' => '3.0.1', 'core-data' => '2.0.17', 'data' => '4.2.1', 'date' => '3.0.1', 'deprecated' => '2.0.5', 'dom' => '2.0.8', 'dom-ready' => '2.0.2', 'edit-post' => '3.1.11', 'editor' => '9.0.11', 'element' => '2.1.9', 'escape-html' => '1.0.1', 'format-library' => '1.2.14', 'hooks' => '2.0.5', 'html-entities' => '2.0.4', 'i18n' => '3.1.1', 'is-shallow-equal' => '1.1.5', 'keycodes' => '2.0.6', 'list-reusable-blocks' => '1.1.21', 'notices' => '1.1.3', 'nux' => '3.0.9', 'plugins' => '2.0.10', 'redux-routine' => '3.0.4', 'rich-text' => '3.0.7', 'shortcode' => '2.0.2', 'token-list' => '1.1.0', 'url' => '2.3.3', 'viewport' => '2.1.1', 'wordcount' => '2.0.3', ); $packages_dependencies = array( 'api-fetch' => array( 'wp-polyfill', 'wp-hooks', 'wp-i18n', 'wp-url' ), 'a11y' => array( 'wp-dom-ready', 'wp-polyfill' ), 'annotations' => array( 'wp-data', 'wp-hooks', 'wp-i18n', 'wp-polyfill', 'wp-rich-text', ), 'autop' => array( 'wp-polyfill' ), 'blob' => array( 'wp-polyfill' ), 'blocks' => array( 'wp-autop', 'wp-blob', 'wp-block-serialization-default-parser', 'wp-data', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-shortcode', 'lodash', ), 'block-library' => array( 'editor', 'lodash', 'wp-api-fetch', 'wp-autop', 'wp-blob', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-editor', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-url', 'wp-viewport', 'wp-rich-text', ), 'block-serialization-default-parser' => array(), 'components' => array( 'lodash', 'moment', 'wp-a11y', 'wp-api-fetch', 'wp-compose', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-rich-text', 'wp-url', ), 'compose' => array( 'lodash', 'wp-element', 'wp-is-shallow-equal', 'wp-polyfill', ), 'core-data' => array( 'wp-data', 'wp-api-fetch', 'wp-polyfill', 'wp-url', 'lodash' ), 'data' => array( 'lodash', 'wp-compose', 'wp-element', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-redux-routine', ), 'date' => array( 'moment', 'wp-polyfill' ), 'deprecated' => array( 'wp-polyfill', 'wp-hooks' ), 'dom' => array( 'lodash', 'wp-polyfill', 'wp-tinymce' ), 'dom-ready' => array( 'wp-polyfill' ), 'edit-post' => array( 'jquery', 'lodash', 'postbox', 'media-models', 'media-views', 'wp-a11y', 'wp-api-fetch', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-dom-ready', 'wp-editor', 'wp-element', 'wp-embed', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-nux', 'wp-plugins', 'wp-polyfill', 'wp-url', 'wp-viewport', ), 'editor' => array( 'jquery', 'lodash', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-notices', 'wp-nux', 'wp-polyfill', 'wp-tinymce', 'wp-token-list', 'wp-url', 'wp-viewport', 'wp-wordcount', 'wp-rich-text', ), 'element' => array( 'wp-polyfill', 'react', 'react-dom', 'lodash', 'wp-escape-html' ), 'escape-html' => array( 'wp-polyfill' ), 'format-library' => array( 'wp-components', 'wp-dom', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-rich-text', 'wp-url', ), 'hooks' => array( 'wp-polyfill' ), 'html-entities' => array( 'wp-polyfill' ), 'i18n' => array( 'wp-polyfill' ), 'is-shallow-equal' => array( 'wp-polyfill' ), 'keycodes' => array( 'lodash', 'wp-polyfill', 'wp-i18n' ), 'list-reusable-blocks' => array( 'lodash', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-polyfill', ), 'notices' => array( 'lodash', 'wp-a11y', 'wp-data', 'wp-polyfill', ), 'nux' => array( 'wp-element', 'lodash', 'wp-components', 'wp-compose', 'wp-data', 'wp-i18n', 'wp-polyfill', 'lodash', ), 'plugins' => array( 'lodash', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-polyfill' ), 'redux-routine' => array( 'wp-polyfill' ), 'rich-text' => array( 'lodash', 'wp-data', 'wp-escape-html', 'wp-polyfill', ), 'shortcode' => array( 'wp-polyfill', 'lodash' ), 'token-list' => array( 'lodash', 'wp-polyfill' ), 'url' => array( 'wp-polyfill' ), 'viewport' => array( 'wp-polyfill', 'wp-element', 'wp-data', 'wp-compose', 'lodash' ), 'wordcount' => array( 'wp-polyfill' ), ); $package_translations = array( 'api-fetch', 'blocks', 'block-library', 'components', 'edit-post', 'editor', 'format-library', 'keycodes', 'list-reusable-blocks', 'nux', ); foreach ( $packages_dependencies as $package => $dependencies ) { $handle = 'wp-' . $package; $path = "/wp-includes/js/dist/$package$suffix.js"; $version = $packages_versions[ $package ]; $scripts->add( $handle, $path, $dependencies, $version, 1 ); if ( in_array( $package, $package_translations, true ) ) { $scripts->set_translations( $handle ); } } }