tombroucke / otomaties-bootstrap-popup
此包的最新版本(2.5.1)没有可用的许可信息。
2.5.1
2024-04-30 13:00 UTC
Requires
- composer/installers: ^2.0
- johnbillion/extended-cpts: ^5.0
- stoutlogic/acf-builder: ^1.12
- tombroucke/wp-models: ^2.1
Requires (Dev)
- dev-master
- 2.5.1
- 2.5.0
- 2.4.3
- 2.4.2
- 2.4.1
- 2.4.0
- 2.3.1
- 2.3.0
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.6
- 2.1.5
- 2.1.4
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.2
- 2.0.1
- 2.0.0
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- dev-snyk-fix-faab6637fd52018250685048b9896ba7
- dev-snyk-fix-ac8b412276a1acd9672be7d21965ff1a
- dev-snyk-fix-5e0c8b4be6428dfd7d8746f7060c333e
- dev-snyk-fix-ea1425993087f20430ecb20dadeacb7c
- dev-snyk-upgrade-a88bec7998a1f67cbbc27efff9f49e42
- dev-snyk-upgrade-2e5eb056a04153006b36a032af0a0697
- dev-snyk-upgrade-4ca97537b7015453d01da7f38dc395c4
This package is auto-updated.
Last update: 2024-09-06 07:19:54 UTC
README
从主题或其它插件加载 Bootstrap JS
如果你在主题或另一个插件中加载了 bootstrap JS,则不需要再次加载。重复加载会导致加载时间变慢,并可能引起冲突。
确保 otomaties-bootstrap-popup 首先加载
$dependencies = wp_script_is('otomaties-bootstrap-popup', 'enqueued') ? ['otomaties-bootstrap-popup'] : []; bundle('app')->enqueueCss()->enqueueJs(true, $dependencies);
不加载 bootstrap 加载javascript
add_filter('otomaties_bootstrap_popup_load_bootstrap', '__return_false');
通过自定义 BootstrapLoaded 事件传递 modal 组件
import { Modal } from 'bootstrap'; const bootstrapComponents = { modal: Modal, } const bootstrapLoadedEvent = new CustomEvent('BootstrapLoaded', {detail: {components : bootstrapComponents}}); window.dispatchEvent(bootstrapLoadedEvent);
过滤器
使用 BS 4.x 而不是 5.x
add_filter('otomaties_bootstrap_popup_bootstrap_version', function() { return '4.x'; });
过滤可用的 bootstrap 主题
otomaties_bootstrap_popup_button_themes
居中弹出窗口
add_filter('otomaties_bootstrap_popup_modal_dialog_classes', function ($classes) { $classes .= ' modal-dialog-centered'; return $classes; });