Plugin Directory

Changeset 3469811


Ignore:
Timestamp:
02/26/2026 02:37:36 AM (12 days ago)
Author:
manovermachine
Message:

Release 1.3.19: Fixed 7-Day Forecast to always display all 7 days regardless of Special Post configuration

Location:
weather-write/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • weather-write/trunk/includes/class-scheduler.php

    r3455666 r3469811  
    359359        do_action( 'wwrt_progress_step', 'validate', 'Configuration validated', true );
    360360
    361         // Fetch weather (extended forecast for special posts)
    362         $forecast_days = 2; // Default: today + tomorrow
     361        // Always fetch 7 days for the forecast table display
     362        $forecast_days = 7;
     363       
     364        // For special posts, store their configured forecast window for AI prompt use
     365        $special_forecast_days = 7; // Default
    363366        if ( $special_post && isset( $special_post['forecast_days'] ) ) {
    364             $forecast_days = (int) $special_post['forecast_days'];
    365             if ( $forecast_days < 1 ) { $forecast_days = 1; }
    366             if ( $forecast_days > 14 ) { $forecast_days = 14; }
     367            $special_forecast_days = (int) $special_post['forecast_days'];
     368            if ( $special_forecast_days < 1 ) { $special_forecast_days = 1; }
     369            if ( $special_forecast_days > 14 ) { $special_forecast_days = 14; }
    367370        }
    368371        do_action( 'wwrt_progress_step', 'weather', 'Fetching weather data from Open-Meteo', false );
     
    467470        if ( $special_post ) {
    468471            // Calculate date range and location for variable replacement
    469             $forecast_days = isset( $special_post['forecast_days'] ) ? (int) $special_post['forecast_days'] : 3;
     472            // Use the special post's configured forecast window (not the 7-day table default)
    470473            $forecast_start = isset( $special_post['forecast_start'] ) ? $special_post['forecast_start'] : 'tomorrow';
    471474            $start_offset = $forecast_start === 'today' ? 0 : 1;
    472475            $start_date = new DateTime( '+' . $start_offset . ' days', wp_timezone() );
    473             $end_date = new DateTime( '+' . ( $start_offset + $forecast_days - 1 ) . ' days', wp_timezone() );
     476            $end_date = new DateTime( '+' . ( $start_offset + $special_forecast_days - 1 ) . ' days', wp_timezone() );
    474477            $date_range = $start_date->format( 'M j' ) . '-' . $end_date->format( 'j' );
    475478           
     
    12131216            $tmin  = isset( $daily['tmin'] ) ? (array) $daily['tmin'] : [];
    12141217            $codes = isset( $daily['code'] ) ? (array) $daily['code'] : [];
     1218
    12151219
    12161220            $temp_unit = isset( $options['temp_unit'] ) ? strtolower( (string) $options['temp_unit'] ) : 'c';
  • weather-write/trunk/readme.txt

    r3455666 r3469811  
    44Requires at least: 6.5
    55Tested up to: 6.8
    6 Stable tag: 1.3.18
     6Stable tag: 1.3.19
    77License: GPLv2 or later
    88License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    8787
    8888== Changelog ==
     89
     90= 1.3.19 =
     91- Fixed: 7-Day Forecast now always displays all 7 days regardless of Special Post forecast configuration
     92- Improved: Special Posts maintain their configured forecast window for AI content while showing full 7-day table
    8993
    9094= 1.3.18 =
  • weather-write/trunk/weather-write.php

    r3455666 r3469811  
    33 * Plugin Name: Weather Write
    44 * Description: Generate and publish weather-aware posts with summaries, charts, images, alerts, SEO, and more — fully automated or on-demand.
    5  * Version: 1.3.18
     5 * Version: 1.3.19
    66 * Author: Mike Freeman - WeatherWrite
    77 * Plugin URI: https://www.weatherwrite.com/
Note: See TracChangeset for help on using the changeset viewer.