From ba44fcdcf8eb05d283134754b64bdf5e889ca42b Mon Sep 17 00:00:00 2001 From: hughie molloy Date: Fri, 1 Mar 2024 15:58:44 +0000 Subject: [PATCH] Adding option to force update syndicated items even if modified date unchanged --- admin-ui.php | 1 + feedwordpresssyndicationpage.class.php | 17 ++++++++++++++++- syndicatedpost.class.php | 5 +++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/admin-ui.php b/admin-ui.php index b089663..33e0de3 100644 --- a/admin-ui.php +++ b/admin-ui.php @@ -556,6 +556,7 @@ function fwp_syndication_manage_page_links_table_rows( $links, $page, $visible =
+
requested_link_ids_sql(); @@ -232,12 +238,20 @@ function updates_requested() $targets_keys = array_keys( $targets ); $first_key = reset( $targets_keys ); + $update_single_action = $targets[$first_key]; + if ( !is_numeric( $first_key) ) : // URLs in keys $targets = $targets_keys; endif; $update_set = $targets; endif; endif; + + if (MyPHP::post('action')==FWP_FORCE_UPDATE_CHECKED or $update_single_action === 'Force Update Now'): + echo "

Force Updating feeds.

"; + add_filter('syndicated_item_force_update', '__return_true'); + endif; + return $update_set; } @@ -858,6 +872,7 @@ function display_button_bar( $showInactive ) { + diff --git a/syndicatedpost.class.php b/syndicatedpost.class.php index 6548aef..e76629b 100644 --- a/syndicatedpost.class.php +++ b/syndicatedpost.class.php @@ -1303,6 +1303,11 @@ function freshness ($format = 'number') { .')' ); + elseif (apply_filters('syndicated_item_force_update', false, $this->item, $old_post)) : + $updated = true; + $updatedReason = ' is being force updated'; + $live = true; + // The date does not indicate a new revision, so // let's check the hash. else :