'0', 'format' => 'full', // Default to full day name ), $atts); $offset = intval($atts['go']); // go the integer value of the days offset // If 'go' attribute is specified, calculate the date based on the offset if ($offset !== 0) { $newDate = gmdate("Y-m-d", strtotime("{$offset} days")); return aiosc_format_day_of_week($atts['format'], strtotime($newDate)); } // If 'go' attribute is not specified, return today's day of the week return aiosc_format_day_of_week($atts['format'], time()); } // Function to format the day of the week based on the format attribute function aiosc_format_day_of_week($format, $timestamp) { if ($format === 'short') { return gmdate("D", $timestamp); } else { return gmdate("l", $timestamp); } } add_shortcode("aio_today", "aiosc_shortcode_today");