' . $title . '
' . $lede . '
__( 'Store page', 'ai-eshop-optimizer' ), 'description' => __( 'One shop from top to bottom: its name and photo with the hours, its people, the walk through the shop with its plan, what can be booked and its events, the way here, one review and the booking form.', 'ai-eshop-optimizer' ), 'content' => self::wrap( $composition ), 'post_types' => array( AIEO_Store_CPT::POST_TYPE ), ) ); register_block_template( self::ARCHIVE, array( 'title' => __( 'Store list', 'ai-eshop-optimizer' ), 'description' => __( 'Every shop as a card: whether it is open now, its address and phone, hours, what is in the shop, how to get there and its Google reviews.', 'ai-eshop-optimizer' ), 'content' => self::wrap( self::archive_body() ), ) ); self::register_after(); add_filter( 'pre_render_block', array( __CLASS__, 'crumbs_fallback' ), 10, 2 ); add_filter( 'woocommerce_get_breadcrumb', array( __CLASS__, 'crumb_archive_name' ) ); } public static function crumb_archive_name( $crumbs ) { if ( ! is_array( $crumbs ) || ! is_singular( AIEO_Store_CPT::POST_TYPE ) ) { return $crumbs; } $type = get_post_type_object( AIEO_Store_CPT::POST_TYPE ); $link = (string) get_post_type_archive_link( AIEO_Store_CPT::POST_TYPE ); if ( ! $type || '' === $link ) { return $crumbs; } foreach ( $crumbs as $i => $crumb ) { if ( is_array( $crumb ) && isset( $crumb[1] ) && untrailingslashit( (string) $crumb[1] ) === untrailingslashit( $link ) ) { $crumbs[ $i ][0] = (string) $type->labels->name; } } return $crumbs; } public static function crumbs_fallback( $pre, $parsed ) { if ( null !== $pre || ! is_array( $parsed ) || 'core/pattern' !== ( $parsed['blockName'] ?? '' ) || self::CRUMBS !== ( $parsed['attrs']['slug'] ?? '' ) || WP_Block_Patterns_Registry::get_instance()->is_registered( self::CRUMBS ) ) { return $pre; } $inner = WP_Block_Type_Registry::get_instance()->is_registered( 'woocommerce/breadcrumbs' ) ? '' : ''; $top = 'var(--wp--custom--rooster--crumbs--offset, var(--wp--preset--spacing--4, 1rem))'; return do_blocks( '' . '
' . $lede . '