PluginProbe
FeedWordPress / 2017.1020
FeedWordPress v2017.1020
trunk 0.8 0.9 0.91 0.95 0.96 0.97 0.98 0.981 0.99 0.991 0.992 0.993 2008.1030 2008.1101 2008.1105 2008.1214 2009.0612 2009.0613 2009.0618 2009.0707 2009.1111 2009.1112 2010.0127 2010.0528 All 65 releases
← All changes | feedwordpresslocalpost.class.php +9 -42 trunk2017.1020 View file →
@@ -16,14 +16,10 @@
16 16 endif;
17 17 }
18 18
19 19 public function id () {
20 - if (is_null($this->post) or !is_object($this->post)) :
21 - return NULL;
22 - else :
23 - return $this->post->ID;
24 - endif;
25 - } /* FeedWordPressLocalPost::id () */
20 + return $this->post->ID;
21 + }
26 22
27 23 public function meta ($what, $params = array()) {
28 24
29 25 // -=-=-= 1. INITIAL SETUP. =-=-=-
@@ -34,14 +30,8 @@
34 30 "unproxied setting" => NULL,
35 31 "unproxy" => false,
36 32 ));
37 33
38 - // If we got put through the_content without a current
39 - // $post object set, then bail out immediately.
40 - if (is_null($this->post) or !is_object($this->post)) :
41 - return $params['default'];
42 - endif;
43 -
44 34 // This is a little weird, just bear with me here.
45 35 $results = array();
46 36
47 37 // Has this been left up to the admin setting?
@@ -53,9 +43,9 @@
53 43
54 44 // Now if we are supposed to look for ultimate source data (e.g. from
55 45 // <atom:source> ... </atom:source> elements), do so here.
56 46 if ($params['unproxy']) :
57 - if ( !is_string($params['unproxied setting'])) :
47 + if (!is_string($params['unproxied setting'])) :
58 48 // Default pattern for unproxied settings: {$name}_original
59 49 $params['unproxied setting'] = $what . '_original';
60 50 endif;
61 51
@@ -72,9 +62,9 @@
72 62
73 63 // -=-=-= 3. DEAL WITH THE RESULTS, IF ANY, OR FALLBACK VALUES. =-=-=-
74 64
75 65 // If we have results now, cool. Just pass them back.
76 - if ( !empty($results)) :
66 + if (!empty($results)) :
77 67 $ret = ($params['single'] ? $results[0] : $results);
78 68
79 69 // If we got no results but we have a fallback global setting, cool. Use
80 70 // that. Jam it into a singleton array for queries expecting an array of
@@ -93,9 +83,9 @@
93 83 return $ret;
94 84 }
95 85
96 86 public function is_syndicated () {
97 - return ( !is_null($this->feed_id(/*single=*/ false)));
87 + return (!is_null($this->feed_id(/*single=*/ false)));
98 88 }
99 89
100 90 public function syndication_permalink () {
101 91 return $this->meta('syndication_permalink');
@@ -145,9 +135,9 @@
145 135
146 136 public function is_exposed_to_formatting_filters () {
147 137
148 138 return (
149 - ! $this->is_syndicated()
139 + !$this->is_syndicated()
150 140 or (
151 141 'yes' == $this->meta(
152 142 '_feedwordpress_formatting_filters',
153 143 array(
@@ -161,43 +151,20 @@
161 151 } /* FeedWordPressLocalPost::is_exposed_to_formatting_filters () */
162 152
163 153
164 154 public function content () {
165 - if (is_null($this->post) or !is_object($this->post)) :
166 - $post_content = NULL;
167 - $post_id = NULL;
168 - else :
169 - $post_content = $this->post->post_content;
170 - $post_id = $this->post->ID;
171 - endif;
172 - return apply_filters('the_content', $post_content, $post_id);
155 + return apply_filters('the_content', $this->post->post_content, $this->post->ID);
173 156 }
174 157
175 158 public function title () {
176 - if (is_null($this->post) or !is_object($this->post)) :
177 - $post_title = NULL;
178 - $post_id = NULL;
179 - else :
180 - $post_title = $this->post->post_title;
181 - $post_id = $this->post->ID;
182 - endif;
183 - return apply_filters('the_title', $post_title, $post_id);
159 + return apply_filters('the_title', $this->post->post_title, $this->post->ID);
184 160 }
185 161
186 162 public function guid () {
187 - if (is_null($this->post) or !is_object($this->post)) :
188 - $post_guid = NULL;
189 - else :
190 - $post_guid = $this->post->guid;
191 - endif;
192 - return apply_filters('get_the_guid', $post_guid);
163 + return apply_filters('get_the_guid', $this->post->guid);
193 164 }
194 165
195 166 public function get_categories () {
196 - if (is_null($this->post) or !is_object($this->post)) :
197 - return array();
198 - endif;
199 -
200 167 $terms = wp_get_object_terms(
201 168 $this->post->ID,
202 169 get_taxonomies(array(
203 170 'public' => true,