Permalink
Browse files

FWP-compatibility - Future proof for when syndicated_item becomes syn…

…dicated_entry.
  • Loading branch information...
Charles Johnson
Charles Johnson committed Jun 1, 2012
1 parent a45d5ac commit e78dbd1a6135630b9639b9637368c88f899e0d93
Showing with 8 additions and 6 deletions.
  1. +8 −6 fwp-keyword-filters.php
View
@@ -108,8 +108,9 @@ function FWPKeywordFilters () {
$this->name = strtolower(get_class($this));
- // Set up functionality
- add_filter('syndicated_item', array(&$this, 'syndicated_item'), 1000, 2);
+ // Set up functionality. Future-proof for when syndicated_item becomes syndicated_entry
+ add_filter('syndicated_item', array(&$this, 'syndicated_entry'), 1000, 2);
+ add_filter('syndicated_entry', array(&$this, 'syndicated_entry'), 1000, 2);
add_filter('syndicated_post', array(&$this, 'syndicated_post'), 1000, 2);
// Set up configuration UI
@@ -143,7 +144,7 @@ function diagnostics ($diag, $page) {
return $diag;
}
- function syndicated_item ($item, $obj) {
+ function syndicated_entry ($entry, $obj) {
$mp = new fwpkfMatchablePost($obj);
$localKeys = maybe_unserialize($obj->link->setting(
@@ -185,11 +186,11 @@ function syndicated_item ($item, $obj) {
if (isset($keys['-'])) :
$this->processRule('-', $keys['-'], $mp);
endif;
-
+
if ($this->filtered) :
- $item = NULL; // Filter it out.
+ $entry = NULL; // Filter it out.
endif;
- return $item;
+ return $entry;
} /* FWPKeywordFilters::syndicated_item () */
function processRule ($word, $actions, $mp) {
@@ -267,6 +268,7 @@ function processRule ($word, $actions, $mp) {
);
$matched = $mp->match($patterns, $comparisonFields);
+
if ($matched) :
$mp->matches = $mp->matches + 1;

0 comments on commit e78dbd1

Please sign in to comment.