Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions admin-ui.php
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ function fwp_syndication_manage_page_links_table_rows( $links, $page, $visible =

<td><div style="float: right; padding-left: 10px">
<input type="submit" class="button" name="update_uri[<?php print esc_html( $link->link_rss ); ?>]" value="<?php esc_html_e( 'Update Now' ); ?>" />
<input type="submit" class="button button-primary" name="update_uri[<?php print esc_html($link->link_rss); ?>]" value="<?php _e('Force Update Now'); ?>" style="background: #EE0606;" />
</div>
<?php
fwp_links_table_rows_last_updated( $o_s_link );
Expand Down
17 changes: 16 additions & 1 deletion feedwordpresssyndicationpage.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
define( 'FWP_PROJECT_WEBSITE_URL', 'https://fwpplugin.com/' );

define( 'FWP_UPDATE_CHECKED', 'Update Checked' );
define( 'FWP_FORCE_UPDATE_CHECKED', 'Force Update Checked' );
define( 'FWP_UNSUB_CHECKED', 'Unsubscribe' );
define( 'FWP_DELETE_CHECKED', 'Delete' );
define( 'FWP_RESUB_CHECKED', 'Re-subscribe' );
Expand Down Expand Up @@ -205,9 +206,14 @@ function updates_requested()
endif;

$update_set = array();
$update_single_action = false;

if ( $fwp_update_invoke != 'get' ) :
if ( is_array( MyPHP::post( 'link_ids' ) )
and ( MyPHP::post( 'action' ) == FWP_UPDATE_CHECKED ) ) :
and (
(MyPHP::post('action')==FWP_UPDATE_CHECKED)
or (MyPHP::post('action')==FWP_FORCE_UPDATE_CHECKED)
)) :
// Get single link ID or multiple link IDs from REQUEST parameters
// if available. Sanitize values for MySQL.
$link_list = $this->requested_link_ids_sql();
Expand All @@ -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 "<p>Force Updating feeds.</p>";
add_filter('syndicated_item_force_update', '__return_true');
endif;

return $update_set;
}

Expand Down Expand Up @@ -858,6 +872,7 @@ function display_button_bar( $showInactive ) {
<input class="button-secondary" type="submit" name="action" value="<?php print esc_attr( FWP_DELETE_CHECKED ); ?>" />
<?php else : ?>
<input class="button-secondary" type="submit" name="action" value="<?php print esc_attr( FWP_UPDATE_CHECKED ); ?>" />
<input class="button-primary" type="submit" name="action" value="<?php print esc_attr(FWP_FORCE_UPDATE_CHECKED); ?>" style="background:#EE0606" />
<input class="button-secondary delete" type="submit" name="action" value="<?php print esc_attr( FWP_UNSUB_CHECKED ); ?>" />
<?php endif ; ?>
</div> <!-- class="alignleft" -->
Expand Down
5 changes: 5 additions & 0 deletions syndicatedpost.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 :
Expand Down