0], $atts); $board_id = intval($atts['id']); if (!$board_id) return '
' . esc_html__('Invalid board ID', 'alba-board') . '
'; include_once(ABSPATH . 'wp-admin/includes/plugin.php'); $addon_active = is_plugin_active('alba-board-frontend-interactions/alba-board-frontend-interactions.php'); ob_start(); $lists = get_posts([ 'post_type' => 'alba_list', 'numberposts' => -1, 'orderby' => 'menu_order', 'order' => 'ASC', 'meta_key' => 'alba_board_parent', 'meta_value' => $board_id ]); $options = get_option('alba_board_limits'); $max_cards = isset($options['limit_cards']) ? intval($options['limit_cards']) : 0; $cards_by_list = []; if (!empty($lists)) { $list_ids = wp_list_pluck($lists, 'ID'); foreach ($list_ids as $lid) { $cards_by_list[$lid] = []; } $all_cards = get_posts([ 'post_type' => 'alba_card', 'numberposts' => -1, 'orderby' => 'menu_order', 'order' => 'ASC', 'meta_query' => [ [ 'key' => 'alba_list_parent', 'value' => $list_ids, 'compare' => 'IN' ] ], 'update_post_term_cache' => true ]); foreach ($all_cards as $card) { $parent_id = get_post_meta($card->ID, 'alba_list_parent', true); if (isset($cards_by_list[$parent_id])) { $cards_by_list[$parent_id][] = $card; } } } echo '