* FeedWordPress::is_null_email ()
public static use_aggregator_source_data ( ) |
public function meta($what, $params = array()) { // -=-=-= 1. INITIAL SETUP. =-=-=- $params = wp_parse_args($params, array("single" => true, "default" => NULL, "global" => NULL, "unproxied setting" => NULL, "unproxy" => false)); // This is a little weird, just bear with me here. $results = array(); // Has this been left up to the admin setting? if (is_null($params['unproxy'])) { $params['unproxy'] = FeedWordPress::use_aggregator_source_data(); } // -=-=-= 2. GET DATA FROM THE PROXIMATE OR THE ULTIMATE SOURCE. =-=-=- // Now if we are supposed to look for ultimate source data (e.g. from // <atom:source> ... </atom:source> elements), do so here. if ($params['unproxy']) { if (!is_string($params['unproxied setting'])) { // Default pattern for unproxied settings: {$name}_original $params['unproxied setting'] = $what . '_original'; } // Now see if there's anything in postmeta from our ultimate source. // If so, then we can cut out the middle man here. $results = get_post_meta($this->post->ID, $params['unproxied setting'], false); } // If we weren't looking for ultimate source data, or if there wasn't // any recorded, then grab this from the data for the proximate source. if (empty($results)) { $results = get_post_meta($this->post->ID, $what, false); } // -=-=-= 3. DEAL WITH THE RESULTS, IF ANY, OR FALLBACK VALUES. =-=-=- // If we have results now, cool. Just pass them back. if (!empty($results)) { $ret = $params['single'] ? $results[0] : $results; // If we got no results but we have a fallback global setting, cool. Use // that. Jam it into a singleton array for queries expecting an array of // results instead of a scalar result. } elseif (is_string($params['global']) and strlen($params['global']) > 0) { $opt = get_option($params['global'], $params['default']); $ret = $params['single'] ? $opt : array($opt); // If we got no results and we have no fallback global setting, pass // back a default value for single-result queries, or an empty array for // multiple-result queries. } else { $ret = $params['single'] ? $params['default'] : array(); } return $ret; }
function get_syndication_source_property($original, $id, $local, $remote = NULL) { $ret = NULL; if (is_null($original)) { $original = FeedWordPress::use_aggregator_source_data(); } if (is_null($remote)) { $remote = $local . '_original'; } $vals = $original ? get_post_custom_values($remote, $id) : array(); if (count($vals) < 1) { $vals = get_post_custom_values($local, $id); } if (count($vals) > 0) { $ret = $vals[0]; } return $ret; }
function get_syndication_feed_guid($original = NULL, $id = NULL) { if (is_null($original)) { $original = FeedWordPress::use_aggregator_source_data(); } if ($original) { $vals = get_post_custom_values('syndication_source_id_original', $id); } else { $vals = array(); } if (count($vals) == 0) { $vals = array(get_feed_meta('feed/id', $id)); } if (count($vals) > 0) { $ret = $vals[0]; } else { $ret = NULL; } return $ret; }