control-new-cruises.sh
Updates and creates new cruise posts in a WordPress site, handling post meta, translations, and itinerary updates.
Usage
./control-new-cruises.sh
Description
- Checks if the script is already running to prevent multiple instances.
- Logs the start time.
- Executes MySQL queries to update and select data from the
ff_traveltek_cruisestable. - For each cruise needing a new post:
- Checks if the cruise ID already exists in the postmeta table.
- If not, creates a new WordPress post with cruise details.
- Inserts post meta data and updates post ID in the database.
- Deletes and inserts cabin grades for the new post.
- If WPML is enabled, creates translations for the new post.
- Runs itinerary update script for the new post.
- Logs the end time of the script.
Dependencies
functions.sh: Utility functions.mysql: MySQL commands.wp: WP-CLI for WordPress operations.
Notes
- Ensure all required environment variables and plugins are set before running.
- Intended for use by developers or system administrators familiar with WordPress and server scripting.
For further details, refer to the comments in the script or contact the development team.