Skip to content

Commit

Permalink
Merge pull request #1050 from Codeinwp/bugfix/pro/815
Browse files Browse the repository at this point in the history
Fixed action scheduler time issue with old method
  • Loading branch information
vytisbulkevicius authored Jan 10, 2025
2 parents d6f868e + 770b335 commit 698bede
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
4 changes: 3 additions & 1 deletion includes/admin/feedzy-rss-feeds-import.php
Original file line number Diff line number Diff line change
Expand Up @@ -834,8 +834,10 @@ public function manage_feedzy_import_columns( $column, $post_id ) {
if ( ! $next ) {
$next = Feedzy_Rss_Feeds_Util_Scheduler::is_scheduled( 'feedzy_cron' );
}
if ( $next ) {
if ( is_numeric( $next ) ) {
echo wp_kses_post( human_time_diff( $next, time() ) );
} elseif ( $next ) {
echo esc_html__( 'in-progress', 'feedzy-rss-feeds' );
}
break;
default:
Expand Down
7 changes: 3 additions & 4 deletions includes/util/feedzy-rss-feeds-util-scheduler.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,13 @@ class Feedzy_Rss_Feeds_Util_Scheduler {
* @return bool|int
*/
public static function is_scheduled( string $hook, array $args = array() ) {
if ( function_exists( 'as_has_scheduled_action' ) ) {
return as_has_scheduled_action( $hook, $args );
}

if ( function_exists( 'as_next_scheduled_action' ) ) {
// For older versions of AS.
return as_next_scheduled_action( $hook, $args );
}
if ( function_exists( 'as_has_scheduled_action' ) ) {
return as_has_scheduled_action( $hook, $args );
}

return wp_next_scheduled( $hook, $args );
}
Expand Down
6 changes: 3 additions & 3 deletions includes/views/import-metabox-edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -674,9 +674,9 @@ class="fz-switch-toggle" type="checkbox" value="yes"
<?php echo esc_attr( $import_feed_delete_media ); ?>>
<label class="feedzy-inline form-label" for="delete-attached-media"><?php esc_html_e( 'Delete attached featured image', 'feedzy-rss-feeds' ); ?></label>
</div>
</div>
<div class="help-text">
<?php echo wp_sprintf( esc_html__( 'Helpful if you want to delete attached featured image when posts are automatically deleted.', 'feedzy-rss-feeds' ) ); ?>
<div class="help-text">
<?php echo wp_sprintf( esc_html__( 'Helpful if you want to delete attached featured image when posts are automatically deleted.', 'feedzy-rss-feeds' ) ); ?>
</div>
</div>
</div>
</div>
Expand Down

0 comments on commit 698bede

Please sign in to comment.