public function add_meta_box_news() { $news_tags = parent::get_option('news_tags'); foreach ((array) $news_tags['post_type'] as $post_type) { // Only include metabox on post types that are included add_meta_box('xmlsf_news_section', __('Google News', 'xml-sitemap-feed'), array($this, 'meta_box_news'), $post_type, 'side'); } }
public function news_keywords_field() { $options = parent::get_option('news_tags'); $prefix = parent::prefix(); $keywords = !empty($options['keywords']) ? $options['keywords'] : array(); $keywords_from = !empty($keywords['from']) ? $keywords['from'] : ''; echo ' <fieldset id="xmlsf_news_keywords"><legend class="screen-reader-text">' . __('Topics (<keywords> tag)', 'xml-sitemap-feed') . '</legend> ' . __('The <keywords> tag is used to help classify the articles you submit to Google News by <strong>topic</strong>.', 'xml-sitemap-feed') . ' <ul> <li><label>' . sprintf(__('Use %s for topics.', 'xml-sitemap-feed'), ' <select name="' . $prefix . 'news_tags[keywords][from]" id="xmlsf_news_tags_keywords_from"> <option value="">' . translate('None') . '</option> <option value="category" ' . selected("category" == $keywords_from, true, false) . '>' . translate('Categories') . '</option> <option value="post_tag" ' . selected("post_tag" == $keywords_from, true, false) . '>' . translate('Tags') . '</option> </select>') . '</label></li>'; if ("category" != $keywords_from) { echo ' <li><label>' . __('Default topic(s):', 'xml-sitemap-feed') . ' <input type="text" name="' . $prefix . 'news_tags[keywords][default]" id="xmlsf_news_tags_keywords_default" value="'; echo !empty($keywords['default']) ? $keywords['default'] : ''; echo '" class="regular-text"></label> <span class="description">' . __('Separate with a comma.', 'xml-sitemap-feed') . '</span></li>'; } echo ' </ul> <p class="description">' . __('Keywords may be drawn from, but are not limited to, the list of <a href="http://www.google.com/support/news_pub/bin/answer.py?answer=116037" target="_blank">existing Google News keywords</a>.', 'xml-sitemap-feed') . '</p> </fieldset>'; }