Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .monorepo-source.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"productId": "funkycommerce-headless",
"repository": "coded-letter/superfunky-theme",
"source": "coded-letter/coded-letter-monorepo@45fa2d52a63e58ceeb931ddc33ef513e30838b6d",
"source": "coded-letter/coded-letter-monorepo@165fb6d20361bfd8a4811cec30febd78cefa3d2d",
"sourcePath": "workspace/backend/wordpress/themes/free/funkycommerce-headless",
"installSlug": "funkycommerce-headless",
"kind": "theme",
Expand Down
7 changes: 7 additions & 0 deletions assets/storefront-ui-strings/en.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"layout.search.style": "Search style",
"layout.search.full_width": "Full-width bar",
"layout.search.expandable": "Icon → expands",
"layout.search.overlay": "Full-screen overlay",
"cart.title": "Your cart",
"cart.aria": "Shopping cart",
"cart.close": "Close cart",
Expand Down Expand Up @@ -682,6 +686,9 @@
"navigation.back_to_top": "Back to top",
"nav.shop": "Shop",
"nav.blog": "Blog",
"inquiry.heading": "Product inquiry",
"inquiry.button": "Ask about this product",
"inquiry.copy": "Send us a message and we will follow up with availability and pricing.",
"inquiry.error": "The inquiry could not be sent. Please try again.",
"inquiry.success": "Your inquiry has been sent. We'll follow up by email shortly.",
"inquiry.field.name": "Name",
Expand Down
7 changes: 7 additions & 0 deletions assets/storefront-ui-strings/ja.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"layout.search.style": "検索スタイル",
"layout.search.full_width": "全幅バー",
"layout.search.expandable": "アイコン → 展開",
"layout.search.overlay": "全画面オーバーレイ",
"cart.title": "カート",
"cart.aria": "ショッピングカート",
"cart.close": "カートを閉じる",
Expand Down Expand Up @@ -682,6 +686,9 @@
"navigation.back_to_top": "ページ上部へ",
"nav.shop": "ショップ",
"nav.blog": "ブログ",
"inquiry.heading": "商品に関するお問い合わせ",
"inquiry.button": "この商品について問い合わせる",
"inquiry.copy": "メッセージをお送りください。在庫状況と価格についてご連絡いたします。",
"inquiry.error": "お問い合わせを送信できませんでした。もう一度お試しください。",
"inquiry.success": "お問い合わせを送信しました。まもなくメールでご連絡します。",
"inquiry.field.name": "お名前",
Expand Down
7 changes: 7 additions & 0 deletions assets/storefront-ui-strings/pl.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"layout.search.style": "Styl wyszukiwania",
"layout.search.full_width": "Pasek pełnej szerokości",
"layout.search.expandable": "Ikona → rozwijane pole",
"layout.search.overlay": "Nakładka pełnoekranowa",
"cart.title": "Twój koszyk",
"cart.aria": "Koszyk zakupowy",
"cart.close": "Zamknij koszyk",
Expand Down Expand Up @@ -682,6 +686,9 @@
"navigation.back_to_top": "Wróć na górę",
"nav.shop": "Sklep",
"nav.blog": "Blog",
"inquiry.heading": "Zapytanie o produkt",
"inquiry.button": "Zapytaj o ten produkt",
"inquiry.copy": "Wyślij nam wiadomość, a skontaktujemy się z Tobą w sprawie dostępności i ceny.",
"inquiry.error": "Nie udało się wysłać zapytania. Spróbuj ponownie.",
"inquiry.success": "Zapytanie zostało wysłane. Wkrótce odpowiemy e-mailem.",
"inquiry.field.name": "Imię i nazwisko",
Expand Down
17 changes: 16 additions & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
exit;
}

define( 'FUNKYCOMMERCE_HEADLESS_VERSION', '1.2.20' );
define( 'FUNKYCOMMERCE_HEADLESS_VERSION', '1.2.21' );

/**
* Whether Superfunky Pro is active and licensed.
Expand Down Expand Up @@ -132,6 +132,7 @@ function funkycommerce_frontend_url( $path = '' ) {
}

require_once get_template_directory() . '/inc/headless-login.php';
require_once get_template_directory() . '/inc/protected-content.php';
require_once get_template_directory() . '/inc/notifications.php';
require_once get_template_directory() . '/inc/checkout-context.php';
require_once get_template_directory() . '/inc/community.php';
Expand Down Expand Up @@ -849,6 +850,20 @@ function funkycommerce_apply_content_shortcode_aliases( $attributes, $tag ) {
'pill' => 'kickers',
);
}
if ( in_array( $tag, array( 'slider', 'carousel', 'grid' ), true ) ) {
$aliases = array_merge(
array(
'content_type' => 'type',
'post_type' => 'type',
'categories' => 'category',
'product_category' => 'category',
'post_category' => 'category',
'tags' => 'tag',
'authors' => 'author',
),
$aliases
);
}
foreach ( $aliases as $alias => $canonical ) {
if ( isset( $attributes[ $alias ] ) && '' !== trim( (string) $attributes[ $alias ] ) ) {
$attributes[ $canonical ] = $attributes[ $alias ];
Expand Down
6 changes: 5 additions & 1 deletion inc/control-center-schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,10 @@ function funkycommerce_layout_control_fields() {
'layout_show_announcement_bar' => $toggle( __( 'Show announcement bar', 'funkycommerce-headless' ), 'yes', 'show_announcement_bar' ),
'layout_announcement_scroll_effect' => $toggle( __( 'Collapse announcement on scroll', 'funkycommerce-headless' ), 'yes', 'announcement_bar_scroll_effect' ),
'layout_header_sticky' => $toggle( __( 'Sticky header', 'funkycommerce-headless' ), 'yes', 'header_sticky' ),
'layout_header_search_variant' => $select( __( 'Header search layout', 'funkycommerce-headless' ), 'full-width', array( 'full-width', 'expandable' ), 'header_search_variant' ),
'layout_header_search_variant' => $select( __( 'Header search layout', 'funkycommerce-headless' ), 'full-width', array( 'full-width', 'expandable', 'overlay' ), 'header_search_variant' ),
'layout_mobile_menu_width' => $select( __( 'Mobile menu width', 'funkycommerce-headless' ), 'standard', array( 'standard', 'wide', 'full' ), 'mobile_menu_width' ),
'layout_mobile_menu_height' => $select( __( 'Mobile menu height', 'funkycommerce-headless' ), 'full', array( 'full', 'content' ), 'mobile_menu_height' ),
'layout_show_code_controls' => $toggle( __( 'Show code block controls', 'funkycommerce-headless' ), 'yes', 'show_code_controls' ),
'layout_header_logo_variant' => $select( __( 'Header logo layout', 'funkycommerce-headless' ), 'text-image', array( 'text', 'image', 'text-image' ), 'header_logo_variant' ),
'layout_header_arrangement' => $select( __( 'Header content arrangement', 'funkycommerce-headless' ), 'classic', array( 'classic', 'single-row', 'centered', 'island' ), 'header_arrangement' ),
'layout_cart_trigger_variant' => $select( __( 'Header cart behavior', 'funkycommerce-headless' ), 'drawer', array( 'drawer', 'dropdown' ), 'cart_trigger_variant' ),
Expand Down Expand Up @@ -340,6 +343,7 @@ function funkycommerce_layout_control_fields() {
'layout_cart' => $select( __( 'Cart layout', 'funkycommerce-headless' ), 'classic', array( 'classic', 'editorial' ), 'cart_layout' ),
'layout_cart_summary' => $select( __( 'Cart summary position', 'funkycommerce-headless' ), 'sticky', array( 'sticky', 'static' ), 'cart_summary_position' ),
'layout_product_archive_hero' => $select( __( 'Product archive hero', 'funkycommerce-headless' ), 'split', array( 'split', 'fullbleed', 'minimal' ), 'product_archive_hero_layout' ),
'layout_show_product_archive_subcategories' => $toggle( __( 'Show subcategories on product category archives', 'funkycommerce-headless' ), 'yes', 'show_product_archive_subcategories' ),
'layout_post_archive_hero' => $select( __( 'Journal archive hero', 'funkycommerce-headless' ), 'split', array( 'split', 'fullbleed', 'minimal' ), 'post_archive_hero_layout' ),
'layout_archive_description_hero' => $toggle( __( 'Show taxonomy description excerpt in archive hero', 'funkycommerce-headless' ), 'no', 'show_archive_description_in_hero' ),
'layout_post_toc' => $select( __( 'Journal post table of contents', 'funkycommerce-headless' ), 'current', array( 'current', 'rail-left', 'rail-right', 'above' ), 'post_toc_layout' ),
Expand Down
39 changes: 35 additions & 4 deletions inc/native-shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,37 @@ function funkycommerce_native_csv_ints( $value ) {
return $ids;
}

/**
* Resolve comma-separated user IDs, logins, or nicenames to user IDs.
*
* A supplied list containing no valid users deliberately resolves to an empty
* result, rather than accidentally removing the author constraint.
*
* @param string $value Raw author filter.
* @return int[]
*/
function funkycommerce_native_author_ids( $value ) {
$ids = array();
foreach ( preg_split( '/[\s,|]+/', trim( (string) $value ) ) as $candidate ) {
if ( '' === $candidate ) {
continue;
}
if ( ctype_digit( $candidate ) && (int) $candidate > 0 ) {
$user = get_user_by( 'id', (int) $candidate );
} else {
$slug = sanitize_title( $candidate );
$user = $slug ? get_user_by( 'slug', $slug ) : false;
if ( ! $user && $slug ) {
$user = get_user_by( 'login', $slug );
}
}
if ( $user ) {
$ids[] = (int) $user->ID;
}
}
return array_values( array_unique( $ids ) );
}

/**
* Parse a comma-separated list of taxonomy term slugs.
*
Expand Down Expand Up @@ -438,7 +469,7 @@ function funkycommerce_native_query_products( $filters, $args_overrides = array(
}

if ( ! empty( $filters['author'] ) ) {
$author_ids = funkycommerce_native_csv_ints( $filters['author'] );
$author_ids = funkycommerce_native_author_ids( $filters['author'] );
if ( ! $author_ids ) {
return $empty;
}
Expand Down Expand Up @@ -558,7 +589,7 @@ function funkycommerce_native_query_posts( $post_type, $filters, $args_overrides
$args['tax_query'] = $tax_query; // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_tax_query
}

$author_ids = ! empty( $filters['author'] ) ? funkycommerce_native_csv_ints( $filters['author'] ) : array();
$author_ids = ! empty( $filters['author'] ) ? funkycommerce_native_author_ids( $filters['author'] ) : array();
if ( $is_community ) {
$visible = function_exists( 'funkycommerce_visible_community_user_ids' ) ? funkycommerce_visible_community_user_ids() : array();
$scoped = $author_ids ? array_values( array_intersect( $author_ids, $visible ) ) : $visible;
Expand Down Expand Up @@ -1127,7 +1158,7 @@ function funkycommerce_native_render_slider( $atts ) {
$kickers = funkycommerce_native_slider_split( $a['kickers'] );

$manual_count = max( count( $titles ), count( $descriptions ), count( $images ), count( $kickers ) );
$is_manual = $manual_count > 0 || '' !== trim( (string) $a['title'] );
$is_manual = in_array( $a['type'], array( 'campaign', 'cinematic' ), true ) || $manual_count > 0;

$slides_html = '';
$count = 0;
Expand Down Expand Up @@ -1167,7 +1198,7 @@ function funkycommerce_native_render_slider( $atts ) {
} else {
$type = in_array( $a['type'], array( 'product', 'post' ), true ) ? $a['type'] : 'product';
$filters = $a;
$filters['limit'] = min( max( 1, (int) $a['slides'] ), max( 1, (int) $a['limit'] ) );
$filters['limit'] = max( 1, (int) $a['limit'] );
$result = funkycommerce_native_query_by_type( $type, $filters );
foreach ( $result['ids'] as $id ) {
$card = funkycommerce_native_card_for_type( $type, $id, $a['card_variant'] );
Expand Down
Loading
Loading