/** * Generate the Editors' Pick URL * * @param boolean $show_headers */ public function generate_rss($show_headers = true) { $options = WPSEO_News::get_options(); // Show output as XML if ($show_headers) { header('Content-Type: application/rss+xml; charset=' . get_bloginfo('charset')); } echo '<?xml version="1.0" encoding="' . get_bloginfo('charset') . '" ?>' . PHP_EOL; echo '<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom">' . PHP_EOL; echo '<channel>' . PHP_EOL; // Atom channel elements echo '<atom:link href="' . get_site_url() . '/editors-pick.rss" rel="self" type="application/rss+xml" />' . PHP_EOL; // Display the main channel tags echo '<link>' . get_site_url() . '</link>' . PHP_EOL; echo '<description>' . get_bloginfo('description') . '</description>' . PHP_EOL; echo '<title>' . get_bloginfo('name') . '</title>' . PHP_EOL; // Display the image tag if an image is set if (isset($options['ep_image_src']) && $options['ep_image_src'] != '') { $this->show_image($options['ep_image_src']); } // Showing the items $this->show_items(); echo '</channel>' . PHP_EOL; echo '</rss>' . PHP_EOL; }
public function __construct() { $this->options = WPSEO_News::get_options(); add_filter('wpseo_save_metaboxes', array($this, 'save'), 10, 1); add_action('add_meta_boxes', array($this, 'add_tab_hooks')); add_filter('add_extra_wpseo_meta_fields', array($this, 'add_meta_fields_to_wpseo_meta')); }
/** * If there are default keywords, use these also in keyword string */ private function get_default_keywords() { $options = WPSEO_News::get_options(); // TODO: add suggested keywords to each post based on category, next to the entire if (isset($options['default_keywords']) && $options['default_keywords'] != '') { $this->add_keywords($options['default_keywords']); } }
public function __construct() { $this->options = WPSEO_News::get_options(); add_action('init', array($this, 'init'), 10); add_filter('wpseo_sitemap_index', array($this, 'add_to_index')); add_action('save_post', array($this, 'invalidate_sitemap')); // Setting stylesheet for cached sitemap add_action('wpseo_sitemap_stylesheet_cache_news', array($this, 'set_stylesheet_cache')); }
/** * Part with HTML for editors pick */ private function editors_pick() { echo '<h2>' . __("Editors' Pick", 'wordpress-seo-news') . '</h2>'; $esc_form_key = 'ep_image_src'; $options = WPSEO_News::get_options(); echo '<label class="select" for="' . $esc_form_key . '">' . __("Editors' Pick Image", 'wordpress-seo-news') . ':</label>'; echo '<input id="' . $esc_form_key . '" type="text" size="36" name="wpseo_news[' . $esc_form_key . ']" value="' . esc_attr($options[$esc_form_key]) . '" />'; echo '<input id="' . $esc_form_key . '_button" class="wpseo_image_upload_button button" type="button" value="' . __('Upload Image', 'wordpress-seo-news') . '" />'; echo '<br class="clear"/>'; echo '<p>' . sprintf(__('You can find your Editors\' Pick RSS feed here: %1$sEditors\' Pick RSS Feed%2$s', 'wordpress-seo-news'), "<a target='_blank' class='button-secondary' href='" . home_url('editors-pick.rss') . "'>", '</a>') . '</p>'; echo '<p>' . sprintf(__('You can submit your Editors\' Pick RSS feed here: %1$sSubmit Editors\' Pick RSS Feed%2$s', 'wordpress-seo-news'), "<a class='button-secondary' href='https://support.google.com/news/publisher/contact/editors_picks' target='_blank'>", '</a>') . '</p>'; }
/** * Update the current version code */ private function update_current_version_code() { $options = WPSEO_News::get_options(); $options['version'] = WPSEO_News::VERSION; update_option('wpseo_news', $options); }