Пример #1
0
<?php

/**
 * Meta Tags Class
 *
 * This class is the base class for creating meta tags and micro data for the site.
 * 
 * This includes handling the WordPress SEO plugin overrides, Schema.org micro data, and other social meta data handling.
 *
 */
PLS_Meta_Tags::init();
class PLS_Meta_Tags
{
    private static $page_tags = array();
    public static function init()
    {
        // TODO:  Why is this wrapped in this conditional?  Use priorities and do not echo...
        if (!self::is_yoast_enabled()) {
            add_filter('wp_head', array(__CLASS__, 'construct_meta_tags'));
        }
        add_filter('wp_title', array(__CLASS__, 'hook_title_tag'), 18, 1);
    }
    public static function is_yoast_enabled()
    {
        // Assume it's not enabled unless we can prove otherwise...
        $enabled = false;
        // Is Yoast WordPress SEO plugin is enabled this single site? (not network-wide)
        $active_plugins = get_option('active_plugins');
        if (in_array("wordpress-seo/wp-seo.php", $active_plugins)) {
            return true;
        }