0, 'fullwidth' => 0 // Parameter for fullwidth override (CSS handled in alba-board-style.css) ], $atts); $board_id = intval($atts['id']); $is_fullwidth = intval($atts['fullwidth']) === 1; if (!$board_id) { return '

' . esc_html__('Invalid board ID', 'alba-board') . '

'; } // 2. Zero-Friction Auto-Capture: Learn the public URL for notifications silently if ( ! is_admin() && get_the_ID() ) { $current_url = get_permalink( get_the_ID() ); $stored_url = get_post_meta( $board_id, 'alba_board_public_url', true ); // Only trigger DB write if the URL has changed (Highly performant, self-healing) if ( $current_url && $current_url !== $stored_url ) { update_post_meta( $board_id, 'alba_board_public_url', $current_url ); } } // 3. Fetch Display Options $display_opts = get_option('alba_board_display', ['show_avatars' => 1, 'theme' => 'default']); $show_avatars = !empty($display_opts['show_avatars']); $theme_class = isset($display_opts['theme']) ? 'alba-theme-' . $display_opts['theme'] : 'alba-theme-default'; // Append fullwidth class if requested if ($is_fullwidth) { $theme_class .= ' alba-board-fullwidth-override'; } ob_start(); // 4. Render "My Tasks Only" filter for logged-in users $current_user_id = get_current_user_id(); if ($current_user_id) { echo '
'; echo ''; echo '
'; } // 5. Query all lists associated with this board $lists = get_posts([ 'post_type' => 'alba_list', 'numberposts' => -1, 'orderby' => 'menu_order', 'order' => 'ASC', 'meta_key' => 'alba_board_parent', 'meta_value' => $board_id ]); $cards_by_list = alba_board_get_cards_grouped_by_list( wp_list_pluck( $lists, 'ID' ) ); echo '
'; echo '
'; echo '
'; // 6. Loop through each list foreach ($lists as $list) { echo '
'; echo '
'; echo '

' . esc_html($list->post_title) . '

'; echo ''; echo '
'; echo '
'; $cards = isset( $cards_by_list[ $list->ID ] ) ? $cards_by_list[ $list->ID ] : []; foreach ($cards as $card) { echo '
'; echo '' . esc_html($card->post_title) . ''; $due_date = get_post_meta($card->ID, 'alba_due_date', true); if (!empty($due_date)) { $formatted_date = date_i18n('M j', strtotime($due_date)); echo '
'; echo ' '; echo esc_html($formatted_date); echo '
'; } echo ''; echo '
'; } echo '
'; // End alba-cards echo '
'; // End alba-list-column } echo '
'; // End alba-board-wrapper echo '
'; // End alba-board-outerwrap // Modal Container ?>