Skip to content

Commit 934fa5f

Browse files
refactor: settings schedule importer
1 parent 1cdf057 commit 934fa5f

2 files changed

Lines changed: 15 additions & 4 deletions

File tree

includes/layouts/settings.php

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ class="btn btn-outline-primary<?php echo 0 === $index ? ' disabled' : ''; ?>" <?
258258
<div class="fz-form-row">
259259
<div class="fz-form-col-6">
260260
<div class="fz-form-group">
261-
<label class="form-label"><?php esc_html_e( 'Schedule', 'feedzy-rss-feeds' ); ?></label>
261+
<label class="form-label"><?php esc_html_e( 'Default Importing Schedule', 'feedzy-rss-feeds' ); ?></label>
262262
<?php
263263
$save_schedule = ! empty( $settings['general']['fz_cron_schedule'] ) ? $settings['general']['fz_cron_schedule'] : '';
264264

@@ -268,6 +268,12 @@ class="btn btn-outline-primary<?php echo 0 === $index ? ' disabled' : ''; ?>" <?
268268
unset( $schedules['hourly'] );
269269
$schedules = array_merge( array( 'hourly' => $hourly ), $schedules );
270270
}
271+
$standard_schedules = array(
272+
'hourly',
273+
'twicedaily',
274+
'daily',
275+
'weekly',
276+
);
271277
?>
272278
<select id="fz-event-schedule" class="form-control fz-select-control" name="fz_cron_schedule">
273279
<?php
@@ -277,11 +283,15 @@ class="btn btn-outline-primary<?php echo 0 === $index ? ' disabled' : ''; ?>" <?
277283
continue;
278284
}
279285
$duplicate_schedule[] = $schedule['interval'];
286+
287+
$display_text = esc_html( $schedule['display'] );
288+
if ( ! in_array( $slug, $standard_schedules, true ) ) {
289+
$display_text .= ' ' . esc_html__( '(externally created)', 'feedzy-rss-feeds' );
290+
}
280291
?>
281-
<option value="<?php echo esc_attr( $slug ); ?>"<?php selected( $save_schedule, $slug ); ?>><?php echo esc_html( $schedule['display'] ); ?> (<?php echo esc_html( $slug ); ?>)</option>
292+
<option value="<?php echo esc_attr( $slug ); ?>"<?php selected( $save_schedule, $slug ); ?>><?php echo esc_html( $display_text ); ?></option>
282293
<?php endforeach; ?>
283294
</select>
284-
<div class="help-text pt-8"><?php esc_html_e( 'How often Feedzy will run the import.', 'feedzy-rss-feeds' ); ?></div>
285295
</div>
286296
</div>
287297
</div>

includes/views/import-metabox-edit.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ class="fz-switch-toggle" type="checkbox" value="yes"
661661
</div>
662662
<div class="fz-right">
663663
<div class="fz-form-group">
664-
<label class="form-label"><?php esc_html_e( 'Default Importing Schedule', 'feedzy-rss-feeds' ); ?></label>
664+
<label class="form-label"><?php esc_html_e( 'Import schedule', 'feedzy-rss-feeds' ); ?></label>
665665
<select id="fz-event-schedule" class="form-control fz-select-control" name="feedzy_meta_data[fz_cron_schedule]"<?php disabled( true, ! feedzy_is_pro() ); ?>>
666666
<?php
667667
$save_schedule = ! empty( $import_schedule['fz_cron_schedule'] ) ? $import_schedule['fz_cron_schedule'] : '';
@@ -685,6 +685,7 @@ class="fz-switch-toggle" type="checkbox" value="yes"
685685
</option>
686686
<?php endforeach; ?>
687687
</select>
688+
<div class="help-text pt-8"><?php esc_html_e( 'Choose how often Feedzy should import new items from your feeds.', 'feedzy-rss-feeds' ); ?></div>
688689
</div>
689690
</div>
690691
</div>

0 commit comments

Comments
 (0)