You've already forked wp-bootstrap
feat: Bootstrap 5 block renderer, widget cards, and sidebar post layout (v1.1.0)
Add BlockRenderer class injecting Bootstrap classes into 8 core block types (table, button, buttons, image, search, quote, pullquote, list) via per-block render_block filters using WP_HTML_Tag_Processor. Add WidgetRenderer class wrapping sidebar widgets in Bootstrap card components with h4 heading hierarchy via dynamic_sidebar_params and widget_block_content filters. Add widget SCSS stylesheet for list styling, search input-group, tag cloud pills, and card-flush list positioning. Add single-sidebar.html.twig as the default post template with two-column Bootstrap layout (col-lg-8 content, col-lg-4 sidebar). Full-width available via template selection. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -757,6 +757,12 @@ if ( ! function_exists( 'wp_bootstrap_block_styles' ) ) :
|
||||
'inline_style' => '
|
||||
.is-style-separator-wide { max-width: none; }',
|
||||
) );
|
||||
|
||||
// core/list - List Group (Bootstrap).
|
||||
register_block_style( 'core/list', array(
|
||||
'name' => 'list-group',
|
||||
'label' => __( 'List Group', 'wp-bootstrap' ),
|
||||
) );
|
||||
}
|
||||
endif;
|
||||
add_action( 'init', 'wp_bootstrap_block_styles' );
|
||||
@@ -790,6 +796,40 @@ if ( ! function_exists( 'wp_bootstrap_init_templates' ) ) :
|
||||
endif;
|
||||
add_action( 'after_setup_theme', 'wp_bootstrap_init_templates' );
|
||||
|
||||
/**
|
||||
* Initialize block renderer for Bootstrap 5 class injection.
|
||||
*
|
||||
* Hooks per-block render_block filters to inject Bootstrap classes
|
||||
* (e.g. .table, .btn, .img-fluid) into core block HTML on the frontend.
|
||||
*
|
||||
* @since 1.1.0
|
||||
*/
|
||||
if ( ! function_exists( 'wp_bootstrap_init_block_renderer' ) ) :
|
||||
function wp_bootstrap_init_block_renderer() {
|
||||
if ( class_exists( '\\WPBootstrap\\Block\\BlockRenderer' ) ) {
|
||||
new \WPBootstrap\Block\BlockRenderer();
|
||||
}
|
||||
}
|
||||
endif;
|
||||
add_action( 'after_setup_theme', 'wp_bootstrap_init_block_renderer' );
|
||||
|
||||
/**
|
||||
* Initialize widget renderer for Bootstrap 5 card wrappers.
|
||||
*
|
||||
* Hooks dynamic_sidebar_params to wrap sidebar widgets in Bootstrap
|
||||
* card components with proper heading structure.
|
||||
*
|
||||
* @since 1.1.0
|
||||
*/
|
||||
if ( ! function_exists( 'wp_bootstrap_init_widget_renderer' ) ) :
|
||||
function wp_bootstrap_init_widget_renderer() {
|
||||
if ( class_exists( '\\WPBootstrap\\Block\\WidgetRenderer' ) ) {
|
||||
new \WPBootstrap\Block\WidgetRenderer();
|
||||
}
|
||||
}
|
||||
endif;
|
||||
add_action( 'after_setup_theme', 'wp_bootstrap_init_widget_renderer' );
|
||||
|
||||
/**
|
||||
* Customize comment form fields with Bootstrap classes.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user