Automatic End for ACF Listings
Automatically updates listing status from 'active' to 'sold' based on the ACF Auction Start Date.
by John Lim · github.com/jldev10/automatic-end-for-acf-listings-ncg-wordpress-plugin
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/jldev10/automatic-end-for-acf-listings-ncg-wordpress-plugin/archive/refs/heads/main.zipRequires WordPress: 5.8+
Description
This plugin automates the status management of your 'listing' custom post types. It runs a daily scheduled job to check the ACF Auction Start Date of your listings. If a listing's start date matches the current date, its status in the listing-status taxonomy is automatically changed from active to ended.
Features
- Automated Status Updates: Moves listings from 'active' to 'ended' automatically.
- Precision Scheduling: Configurable daily execution time via WordPress Settings API.
- Smart Querying: Efficiently targets only relevant listings using
WP_Query. - Logging: Basic error logging to tracking the start and completion of the automation job.
Requirements
- Custom Post Type:
listing - Taxonomy:
listing-status(with termsactiveandended) - ACF Field:
auction_start_date(Date format:Ymd)
Installation
- Upload the plugin folder to the
/wp-content/plugins/directory. - Activate the plugin through the 'Plugins' menu in WordPress.
- Go to Settings > Auto End Listings to configure the daily execution time.
Configuration
Execution Time
You can set the exact time of day you want the automation to run.
- Navigate to Settings > Auto End Listings.
- Enter the time in the Daily Execution Time field.
- Save Changes.
The scheduler uses your WordPress server time.
Verification
To verify the job plays out as expected, you can use the WP Crontrol plugin:
- Go to Tools > Cron Events.
- Find
aeal_daily_event. - Click Run Now to force a check immediately.
Changelog
1.0.0
- Initial release.
- Implemented settings page, cron scheduling, and automation logic.