Changeset 3470773
- Timestamp:
- 02/27/2026 12:19:22 AM (10 days ago)
- Location:
- weather-write/trunk
- Files:
-
- 5 edited
-
includes/class-admin.php (modified) (2 diffs)
-
includes/class-scheduler.php (modified) (2 diffs)
-
includes/special-posts-admin.php (modified) (5 diffs)
-
readme.txt (modified) (2 diffs)
-
weather-write.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
weather-write/trunk/includes/class-admin.php
r3455666 r3470773 4756 4756 $post_data = [ 4757 4757 'name' => isset( $_POST['name'] ) ? sanitize_text_field( $_POST['name'] ) : '', 4758 'enabled' => ! empty( $_POST['enabled']),4758 'enabled' => isset( $_POST['enabled'] ) && filter_var( $_POST['enabled'], FILTER_VALIDATE_BOOLEAN ), 4759 4759 'day' => isset( $_POST['day'] ) ? (int) $_POST['day'] : 5, 4760 4760 'time' => isset( $_POST['time'] ) ? sanitize_text_field( $_POST['time'] ) : '17:00', … … 4764 4764 'title_prompt' => isset( $_POST['title_prompt'] ) ? wp_kses_post( $_POST['title_prompt'] ) : '', 4765 4765 'custom_prompt' => isset( $_POST['custom_prompt'] ) ? wp_kses_post( $_POST['custom_prompt'] ) : '', 4766 'include_events' => ! empty( $_POST['include_events']),4766 'include_events' => isset( $_POST['include_events'] ) && filter_var( $_POST['include_events'], FILTER_VALIDATE_BOOLEAN ), 4767 4767 'post_status' => isset( $_POST['post_status'] ) ? sanitize_text_field( $_POST['post_status'] ) : 'publish', 4768 'category' => isset( $_POST['category'] ) ? (int) $_POST['category'] : 0, 4768 4769 'tags' => isset( $_POST['tags'] ) && is_array( $_POST['tags'] ) ? array_map( 'sanitize_text_field', $_POST['tags'] ) : [], 4769 4770 'featured_image_url' => isset( $_POST['featured_image_url'] ) ? esc_url_raw( $_POST['featured_image_url'] ) : '', -
weather-write/trunk/includes/class-scheduler.php
r3469811 r3470773 475 475 $start_date = new DateTime( '+' . $start_offset . ' days', wp_timezone() ); 476 476 $end_date = new DateTime( '+' . ( $start_offset + $special_forecast_days - 1 ) . ' days', wp_timezone() ); 477 $date_range = $start_date->format( 'M j' ) . '-' . $end_date->format( 'j' ); 477 // Show both month names if the range crosses months 478 if ( $start_date->format( 'm' ) !== $end_date->format( 'm' ) ) { 479 $date_range = $start_date->format( 'M j' ) . ' - ' . $end_date->format( 'M j' ); 480 } else { 481 $date_range = $start_date->format( 'M j' ) . '-' . $end_date->format( 'j' ); 482 } 478 483 479 484 $location = ''; … … 745 750 $cat_id = ( isset( $options['default_category'] ) && (int)$options['default_category'] > 0 ) ? (int) $options['default_category'] : 0; 746 751 747 // Override status and tags for special posts if configured752 // Override status, category, and tags for special posts if configured 748 753 if ( $special_post ) { 749 754 if ( isset( $special_post['post_status'] ) && $special_post['post_status'] !== '' ) { 750 755 $status = $special_post['post_status']; 756 } 757 if ( isset( $special_post['category'] ) && (int) $special_post['category'] > 0 ) { 758 $cat_id = (int) $special_post['category']; 751 759 } 752 760 if ( isset( $special_post['tags'] ) && is_array( $special_post['tags'] ) && ! empty( $special_post['tags'] ) ) { -
weather-write/trunk/includes/special-posts-admin.php
r3455666 r3470773 266 266 <tr> 267 267 <th scope="row"> 268 <label for="wwrt-sp-category"><?php esc_html_e( 'Category', 'weather-write' ); ?></label> 269 </th> 270 <td> 271 <?php 272 $categories = get_categories( [ 'hide_empty' => false ] ); 273 ?> 274 <select id="wwrt-sp-category" class="regular-text"> 275 <option value="0"><?php esc_html_e( 'Use Default Category', 'weather-write' ); ?></option> 276 <?php foreach ( $categories as $cat ) : ?> 277 <option value="<?php echo esc_attr( $cat->term_id ); ?>"><?php echo esc_html( $cat->name ); ?></option> 278 <?php endforeach; ?> 279 </select> 280 <p class="description"><?php esc_html_e( 'Select a category for this special post. If not set, the default category from Settings will be used.', 'weather-write' ); ?></p> 281 </td> 282 </tr> 283 <tr> 284 <th scope="row"> 268 285 <label for="wwrt-sp-tags"><?php esc_html_e( 'Tags', 'weather-write' ); ?></label> 269 286 </th> … … 410 427 $('#wwrt-sp-include-events').prop('checked', true); 411 428 $('#wwrt-sp-post-status').val('publish'); 429 $('#wwrt-sp-category').val('0'); 412 430 $('#wwrt-sp-tags').val(''); 413 431 $('#wwrt-sp-featured-image').val(''); … … 427 445 $('#wwrt-sp-include-events').prop('checked', preset.include_events !== false); 428 446 $('#wwrt-sp-post-status').val(preset.post_status || 'publish'); 447 $('#wwrt-sp-category').val(preset.category || '0'); 429 448 $('#wwrt-sp-tags').val((preset.tags || []).join(', ')); 430 449 $('#wwrt-sp-featured-image').val(preset.featured_image_url || ''); … … 454 473 $('#wwrt-sp-include-events').prop('checked', post.include_events !== false); 455 474 $('#wwrt-sp-post-status').val(post.post_status || 'publish'); 475 $('#wwrt-sp-category').val(post.category || '0'); 456 476 $('#wwrt-sp-tags').val((post.tags || []).join(', ')); 457 477 $('#wwrt-sp-featured-image').val(post.featured_image_url || ''); … … 483 503 include_events: $('#wwrt-sp-include-events').is(':checked'), 484 504 post_status: $('#wwrt-sp-post-status').val(), 505 category: parseInt($('#wwrt-sp-category').val()), 485 506 tags: tags 486 507 }; -
weather-write/trunk/readme.txt
r3469811 r3470773 4 4 Requires at least: 6.5 5 5 Tested up to: 6.8 6 Stable tag: 1.3. 196 Stable tag: 1.3.20 7 7 License: GPLv2 or later 8 8 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 87 87 88 88 == Changelog == 89 90 = 1.3.20 = 91 - Added: Category selection for Special Posts - each special post can now be assigned to a unique category 92 - Fixed: Special Post date ranges now properly display both month names when crossing month boundaries (e.g., "Feb 27 - Mar 3" instead of "Feb 27-3") 93 - Fixed: Enabled checkbox in Special Posts modal now properly saves disabled state 94 - Fixed: Include Events checkbox in Special Posts modal now properly saves disabled state 89 95 90 96 = 1.3.19 = -
weather-write/trunk/weather-write.php
r3469811 r3470773 3 3 * Plugin Name: Weather Write 4 4 * Description: Generate and publish weather-aware posts with summaries, charts, images, alerts, SEO, and more — fully automated or on-demand. 5 * Version: 1.3. 195 * Version: 1.3.20 6 6 * Author: Mike Freeman - WeatherWrite 7 7 * Plugin URI: https://www.weatherwrite.com/
Note: See TracChangeset
for help on using the changeset viewer.