<?php

namespace ProudNerds\Common;

use ProudNerds\Trait\Initializable;

class Filters
{
    use Initializable;

    public function __construct()
    {
        /**
         * Disable the prev/next meta links
         *
         * We don't want to use these, because they are not SEO friendly when
         * using ajax to load the next page or infinite scroll or when we are
         * not using the main query for our posts.
         *
         * Setting rel="prev" and rel="next" inside pagination.twig is the way to go.
         *
         * Please note that Google doesn't even use these links anymore, so it's
         * only important for other search engines.
         */
        add_filter('wpseo_next_rel_link', '__return_false');
        add_filter('wpseo_prev_rel_link', '__return_false');
        add_filter('admin_footer_text', [$this, 'adminFooterText']);
        add_filter('roots/bedrock/disallow_indexing_admin_notice', '__return_false');
    }

    /**
     * Change the admin footer text
     *
     * @return string
     */
    public function adminFooterText(): string
    {
        return 'Made with ❤️ by <a href="https://www.proudnerds.com" target="_blank">Proud Nerds</a>';
    }
}
