=== YBP Schedule Rewrite ===
Contributors: HISCO, YBP
Donate link: https://your-best-partner.site/
Tags: rewrite, schedule, post update, meta description, classic editor
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Requires Plugins: classic-editor
Stable tag: 1.3.10
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Schedule future updates for published posts (Classic Editor only), including title, content, excerpt, featured image, and SEO meta descriptions.

== Description ==

YBP Schedule Rewrite is a powerful WordPress utility designed to schedule full content updates for existing published posts.

**Note: This plugin is designed exclusively for the Classic Editor.**

Instead of replacing published content immediately or using complex staging setups, YBP Schedule Rewrite allows you to draft new titles, body content, excerpts, featured images, and SEO meta descriptions directly within the Classic Editor metabox, scheduling them to overwrite the live post at a specific date and time via WP-Cron.

= Key Features =

* **Classic Editor Exclusive**: Specifically built for environments using the Classic Editor plugin.
* **Scheduled Post Rewriting**: Set a future date and time to automatically update existing post content.
* **Granular Field Updates**: Draft title, content, excerpt, featured image, and meta descriptions independently. Unchanged fields remain safely protected on the live post.
* **SEO Meta Description Sync**: Automatically update meta description custom fields for third-party themes and SEO plugins.
* **Fallback & Copy Control**: Option to automatically fall back to the excerpt when the dedicated meta description field is empty, or use the "Copy from Excerpt" button in manual mode.
* **Date Reset Option**: Option to update the original published date (`post_date`) to the current time upon rewrite execution for resetting old post metrics.
* **Flexible Sorting Controls**: Options to align scheduled rewrites and new scheduled posts chronologically in the admin post list, and enable modified-date sorting for front-end displays.
* **Automatic Modified Date Column**: Automatically adds a "Last Modified" column to the admin post list when missing in the active theme.

= Supported Meta Description Keys (Examples) =

You can configure your custom field key in `Settings -> YBP Auto Rewrite`:

* **SWELL**: `swell_meta_description`
* **SANGO**: `sango_meta_description`
* **Cocoon**: `the_page_meta_description`
* **AFFINGER**: `st_description`
* **JIN / JIN:R**: `jin_seo_description`
* **THE THOR**: `thor_meta_description`
* **All in One SEO**: `_aioseo_description`
* **Yoast SEO**: `_yoast_wpseo_metadesc`
* **Rank Math**: `rank_math_description`
* **SEOPress**: `_seopress_titles_desc`

== Installation ==

1. Ensure the **Classic Editor** plugin is installed and activated.
2. Upload the `ybp-auto-rewrite` directory to the `/wp-content/plugins/` directory.
3. Activate the plugin through the 'Plugins' menu in WordPress.
4. Navigate to `Settings -> YBP Auto Rewrite` to configure SEO meta description custom field settings.

== Frequently Asked Questions ==

= Does this plugin work with the Block Editor (Gutenberg)? =

No. This plugin is built exclusively for the Classic Editor environment.

= Will this overwrite my live post immediately when saving? =

No. The input data is stored safely as temporary metadata and will only overwrite your live post when the scheduled WP-Cron event fires.

= What happens if I leave some fields blank in the rewrite metabox? =

Blank fields will not erase your existing live post data. YBP Schedule Rewrite safely preserves any live field that does not have new scheduled data.

== Changelog ==

= 1.3.10 =
* Fixed admin post list sorting so scheduled rewrites and new scheduled posts are correctly integrated into the same chronological order.
* New scheduled posts now use their scheduled publication date (`post_date`) when sorting, while scheduled rewrites use their rewrite schedule date and regular published posts use the configured modified or published date.
* Fixed an issue where the "Rewrite Scheduled" status could appear on drafts or published posts that did not actually have a scheduled rewrite.

= 1.3.6 =
* Fixed sorting logic in the "Scheduled" tab to ensure standard future posts are properly ordered by scheduled release date (`post_date`) rather than modified date.

= 1.3.5 =
* Automatically added a "Last Modified" column to the admin post list for themes that do not natively display post modified dates.

= 1.3.4 =
* Fixed admin sorting logic to order posts by modified date (`post_modified`) when no scheduled rewrite date is set.

= 1.3.3 =
* Fixed time zone calculation issue where scheduled rewrite dates in the admin post list were displayed with a UTC offset.
* Fixed undefined variable warning in pre_get_posts query filter for front-end display.

= 1.3.2 =
* Maintenance update.

= 1.3.1 =
* Formatted the scheduled rewrite date and time display in the admin post list to follow the site's WordPress General Settings (date and time formats).

= 1.3.0 =
* Displayed scheduled rewrite date and time in the standard Date column under the published date.

= 1.2.1 =
* Fixed query logic in admin post list so that both new scheduled posts and scheduled rewrites are properly displayed under the "Scheduled" status tab.

= 1.2.0 =
* Added "Rewrite Scheduled" status indicator next to post titles in the admin post list.

= 1.1.0 =
* Added admin post list sorting options and front-end display sorting option.

= 1.0.0 =
* Initial official release.