/** * Hook into the feed content * @param type $content * @param type $feed_type * @return $content * @see http://wp.smashingmagazine.com/2011/12/07/10-tips-optimize-wordpress-theme/ */ function ts_feed_spruce_the_content_feed($content, $feed_type) { global $post; /* if (has_post_thumbnail($post->ID) ) $content = '<p>' . get_the_post_thumbnail($post->ID, 'thumbnail') . '</p>' . $content; */ $options = ts_feed_spruce_get_options(); if ($options['sociallinks']) { $content .= '<p class="social-links">'; $content .= ts_feed_spruce_get_social_links(get_permalink(), get_the_title_rss()); $content .= '</p>'; } if (!empty($options['append'])) { $content .= '<p class="appended">'; $content .= str_ireplace(array('%id%', '%url%'), array(get_the_ID(), apply_filters('the_permalink_rss', get_permalink())), $options['append']); $content .= '</p>'; } return $content; }
function ts_feed_spruce_option_field_append() { global $wp_version; $options = ts_feed_spruce_get_options(); $name = 'append'; ?> <fieldset><?php if (version_compare($wp_version, "3.3", "<")) { ?> <textarea name="ts_feed_spruce_options[<?php echo $name; ?> ]" id="<?php echo $name; ?> " rows="8" cols="40" class="regular-text code"><?php echo $options[$name]; ?> </textarea> <?php } else { $settings = array('media_buttons' => false, 'textarea_name' => 'ts_feed_spruce_options[' . $name . ']', 'textarea_rows' => 8, 'editor_class' => 'regular-text', 'teeny' => true, 'dfw' => true); wp_editor($options[$name], $name, $settings); } ?> <br /><label for="<?php echo $name; ?> "><span class="description"><?php _e('Append text or code to each item. Use <code>%id%</code> to echo the post ID, or <code>%url%</code> for the permalink.'); ?> </span></label></fieldset><?php }