Esempio n. 1
0
 /**
  * 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']);
     }
 }
Esempio n. 2
0
 /**
  * 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>';
 }
 /**
  * Create a wp_query object and return this
  *
  * @return WP_Query
  */
 private function get_ep_query()
 {
     return new WP_Query(array('post_type' => WPSEO_News::get_included_post_types(), 'post_status' => 'publish', 'meta_query' => array(array('key' => '_yoast_wpseo_newssitemap-editors-pick', 'value' => 'on')), 'order' => 'DESC', 'orderby' => 'date'));
 }
Esempio n. 4
0
 public function __construct()
 {
     parent::__construct('https://yoast.com/edd-sl-api', 'News SEO', plugin_basename(WPSEO_News::get_file()), WPSEO_News::VERSION, 'https://yoast.com/wordpress/plugins/news-seo/', 'admin.php?page=wpseo_licenses#top#licenses', 'wordpress-seo-news', 'Yoast');
 }
 /**
  * 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);
 }
Esempio n. 6
0
 /**
  * Check if current post_type is supported
  *
  * @return bool
  */
 private function is_post_type_supported()
 {
     static $is_supported;
     if ($is_supported === null) {
         global $post;
         // Default is false
         $is_supported = false;
         // Get supported post types
         $post_types = WPSEO_News::get_included_post_types();
         // Display content if post type is supported
         if (!empty($post_types) && in_array($post->post_type, $post_types)) {
             $is_supported = true;
         }
     }
     return $is_supported;
 }
Esempio n. 7
0
 /**
  * Getting the post_types which will be displayed in the sitemap
  *
  * @return array|string
  */
 private function get_post_types()
 {
     // Get supported post types
     $post_types = WPSEO_News::get_included_post_types();
     if (count($post_types) > 0) {
         $post_types = "'" . implode("','", $post_types) . "'";
     }
     return $post_types;
 }
Esempio n. 8
0
 /**
  * Check if current post_type is supported
  *
  * @return bool
  */
 private function is_post_type_supported()
 {
     static $is_supported;
     if ($is_supported === null) {
         // Default is false.
         $is_supported = false;
         $post = $this->get_metabox_post();
         if (is_a($post, 'WP_Post')) {
             // Get supported post types.
             $post_types = WPSEO_News::get_included_post_types();
             // Display content if post type is supported.
             if (!empty($post_types) && in_array($post->post_type, $post_types)) {
                 $is_supported = true;
             }
         }
     }
     return $is_supported;
 }