public function should_generate_opengraph_tags($should, AWPCP_Meta $meta) { if (defined('WPSEO_VERSION') && class_exists('WPSEO_OpenGraph')) { $this->metadata = $meta->get_listing_metadata(); add_filter('wpseo_opengraph_type', array($this, 'og_type')); add_filter('wpseo_opengraph_title', array($this, 'og_title')); add_filter('wpseo_opengraph_desc', array($this, 'og_description')); add_filter('wpseo_opengraph_url', array($this, 'og_url')); add_filter('wpseo_og_article_published_time', array($this, 'og_published_time')); add_filter('wpseo_og_article_modified_time', array($this, 'og_modified_time')); add_filter('wpseo_opengraph_image', array($this, 'og_image')); add_action('wpseo_opengraph', array($this, 'maybe_render_og_image_tag'), 90); return false; } return $should; }
public function should_generate_opengraph_tags($should, AWPCP_Meta $meta) { if (!function_exists('amt_get_metadata_head')) { return $should; } $options = get_option('add_meta_tags_opts'); if ($options['auto_opengraph'] == '1') { $this->metadata = $meta->get_listing_metadata(); add_filter('amt_opengraph_metadata_head', array($this, 'overwrite_opengraph_metadata')); return false; } else { if (!empty($options['site_wide_meta'])) { $this->metadata = $meta->get_listing_metadata(); add_filter('amt_basic_metadata_head', array($this, 'remove_opengraph_metadata')); return $should; } } return $should; }