Skip to content

Commit

Permalink
Improve name of calculate_scheduled_dates
Browse files Browse the repository at this point in the history
  • Loading branch information
gikaragia committed Apr 11, 2024
1 parent 5ec384b commit 7ae9d33
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions includes/forms/class-wp-job-manager-form-submit-job.php
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ protected function save_job( $post_title, $post_content, $status = 'preview', $v
];

if ( ! empty( $values['job']['job_schedule_listing'] ) ) {
$is_scheduled_date = $this->calculate_scheduled_dates( $job_data, $values['job']['job_schedule_listing'] );
$is_scheduled_date = $this->apply_scheduled_date( $job_data, $values['job']['job_schedule_listing'] );

if ( ! $is_scheduled_date ) {
unset( $values['job']['job_schedule_listing'] );
Expand Down Expand Up @@ -1076,7 +1076,7 @@ public function preview() {
*
* @return bool True when the scheduled date is a valid future date, false otherwise.
*/
public static function calculate_scheduled_dates( array &$job_data, string $scheduled_date ): bool {
public static function apply_scheduled_date( array &$job_data, string $scheduled_date ): bool {
$maybe_formatted_date = self::maybe_format_future_datetime( $scheduled_date );

if ( false === $maybe_formatted_date ) {
Expand Down Expand Up @@ -1148,7 +1148,7 @@ public function preview_handler() {
$update_job['post_author'] = get_current_user_id();

$job_schedule_listing_date = get_post_meta( $job->ID, '_job_schedule_listing', true );
$this->calculate_scheduled_dates( $update_job, $job_schedule_listing_date );
$this->apply_scheduled_date( $update_job, $job_schedule_listing_date );

wp_update_post( $update_job );
}
Expand Down

0 comments on commit 7ae9d33

Please sign in to comment.