__( 'Bongoto', 'bongoto-shop' ), ) ); } } add_action( 'init', 'bongoto_shop_register_pattern_category' ); /** * 3) Register Block Styles (Buttons — Rounded) * Loads a small CSS file only when used. */ function bongoto_shop_register_block_styles() { $handle = 'bongoto-shop-block-styles'; $rel = 'block-styles/buttons-rounded.css'; // Theme-based paths only; no plugin constants. $base_dir = trailingslashit( get_template_directory() ); $base_uri = trailingslashit( get_template_directory_uri() ); $path = $base_dir . $rel; $uri = $base_uri . $rel; if ( file_exists( $path ) ) { $theme = wp_get_theme(); $ver = $theme->get( 'Version' ) ? $theme->get( 'Version' ) : BONGOTO_SHOP_VERSION; wp_register_style( $handle, $uri, array(), $ver ); if ( function_exists( 'register_block_style' ) ) { register_block_style( 'core/button', array( 'name' => 'bongoto-buttons-rounded', 'label' => __( 'Rounded (Bongoto)', 'bongoto-shop' ), 'style_handle' => $handle, ) ); } } } add_action( 'init', 'bongoto_shop_register_block_styles' ); /** * 4) Image sizes — show in media size dropdown. */ function bongoto_shop_image_size_names( $sizes ) { $sizes['bongoto-thumb'] = __( 'Bongoto Thumb (540×360 crop)', 'bongoto-shop' ); $sizes['bongoto-card'] = __( 'Bongoto Card (720×480 crop)', 'bongoto-shop' ); return $sizes; } add_filter( 'image_size_names_choose', 'bongoto_shop_image_size_names' ); /** * 5) Tidy excerpt “more” string. */ function bongoto_shop_excerpt_more( $more ) { if ( is_admin() ) { return $more; } return '…'; } add_filter( 'excerpt_more', 'bongoto_shop_excerpt_more' ); /** * 6) Register Footer Sidebars (Contact + Columns) * - Footer Contact: left area under logo * - Footer Column 1..6: right grid columns */ function bongoto_shop_register_sidebars() { // Left: contact area under logo. register_sidebar( array( /* translators: Footer Contact widget area name */ 'name' => __( 'Footer Contact', 'bongoto-shop' ), 'id' => 'footer-contact', 'description' => __( 'Left area under logo in the footer. Add a Text/HTML widget for contact info.', 'bongoto-shop' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); // Right: up to 6 columns (theme renders as many as selected in Customizer). for ( $i = 1; $i <= 6; $i++ ) { register_sidebar( array( /* translators: Footer Column widget area name. %d: column number */ 'name' => sprintf( __( 'Footer Column %d', 'bongoto-shop' ), $i ), 'id' => 'footer-' . $i, 'description' => __( 'Footer widget column area.', 'bongoto-shop' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); } } add_action( 'widgets_init', 'bongoto_shop_register_sidebars' ); /** * 7) Pro status helper (back-compat wrapper) * * Old code may still call bongoto_is_pro_active(). * Internally this just proxies to bongoto_shop_is_pro_active(). */ if ( ! function_exists( 'bongoto_is_pro_active' ) ) { function bongoto_is_pro_active() { if ( function_exists( 'bongoto_shop_is_pro_active' ) ) { return bongoto_shop_is_pro_active(); } return false; } }