Permalink
Browse files

SyndicatedPost+FeedWordPressLocalPost / Allow closer emulation of syn…

…dicated posts by local posts for after-the-fact filtering, etc.
  • Loading branch information...
radgeek committed Jul 8, 2014
1 parent a09d78b commit 076efb5cba13c661c16588160640eb2620715965
Showing with 44 additions and 0 deletions.
  1. +36 −0 feedwordpresslocalpost.class.php
  2. +8 −0 syndicatedpost.class.php
@@ -148,5 +148,41 @@ public function is_exposed_to_formatting_filters () {
} /* FeedWordPressLocalPost::is_exposed_to_formatting_filters () */
+
+ public function content () {
+ return apply_filters('the_content', $this->post->post_content, $this->post->ID);
+ }
+
+ public function title () {
+ return apply_filters('the_title', $this->post->post_title, $this->post->ID);
+ }
+
+ public function guid () {
+ return apply_filters('get_the_guid', $this->post->guid);
+ }
+
+ public function get_categories () {
+ $terms = wp_get_object_terms(
+ $this->post->ID,
+ get_taxonomies(array(
+ 'public' => true,
+ ), 'names'),
+ 'all'
+ );
+ $rootUrl = get_bloginfo('url');
+
+ $cats = array();
+ foreach ($terms as $term) :
+ $taxUrl = MyPHP::url($rootUrl, array("taxonomy" => $term->taxonomy));
+ //array("taxonomy" => $term->taxonomy ));
+ $cats[] = new SimplePie_Category(
+ /*term=*/ $term->slug,
+ /*scheme=*/ $taxUrl,
+ /*label=*/ $term->name
+ );
+ endforeach;
+ return $cats;
+ }
+
} /* class FeedWordPressLocalPost */
View
@@ -580,6 +580,14 @@ function xpath_possible_namespaces ($node, $datum = array()) {
return array_unique($ns);
} /* SyndicatedPost::xpath_possible_namespaces() */
+ function get_categories ($params = array()) {
+ return $this->entry->get_categories();
+ }
+
+ function title ($params = array()) {
+ return $this->entry->get_title();
+ } /* SyndicatedPost::title () */
+
function content ($params = array()) {
$params = wp_parse_args($params, array(
"full only" => false,

0 comments on commit 076efb5

Please sign in to comment.