<commit_before><?php

namespace Modularity\Module\Breadcrumbs;

class Breadcrumbs extends \Modularity\Module
{
    public $slug = 'breadcrumbs';
    public $supports = array();
    public $displaySettings = null;


    public function init()
    {
        $this->nameSingular = __('Breadcrumbs', 'modularity');
        $this->namePlural = __('Breadcrumbs', 'modularity');
        $this->description = __('Outputs the navigational breadcrumb trail to the current page.', 'modularity');
    }

    public function data() : array
    {
        $data = array();
        
        $theme = wp_get_theme('municipio');
        if ($theme->exists()) {
            $municipio = new \Municipio\Controller\BaseController;
            $breadcrumb = new \Municipio\Helper\Navigation('breadcrumb');
            $data['breadcrumbItems'] = $breadcrumb->getBreadcrumbItems($municipio->getPageID());
        }
        return $data;
    }

    /**
     * Available "magic" methods for modules:
     * init()            What to do on initialization
     * data()            Use to send data to view (return array)
     * style()           Enqueue style only when module is used on page
     * script            Enqueue script only when module is used on page
     * adminEnqueue()    Enqueue scripts for the module edit/add page in admin
     * template()        Return the view template (blade) the module should use when displayed
     */
}<commit_msg>Unset Municipio breadcrumbs if module is used on the page<commit_after><?php

namespace Modularity\Module\Breadcrumbs;

class Breadcrumbs extends \Modularity\Module
{
    public $slug = 'breadcrumbs';
    public $supports = array();
    public $displaySettings = null;


    public function init()
    {
        $this->nameSingular = __('Breadcrumbs', 'modularity');
        $this->namePlural = __('Breadcrumbs', 'modularity');
        $this->description = __('Outputs the navigational breadcrumb trail to the current page.', 'modularity');
        
        add_filter('Municipio/Breadcrumbs/Items', array( $this, 'unsetMunicipioBreadcrumbs' ), 1, 3);
    }

    public function unsetMunicipioBreadcrumbs($pageData, $queriedObj, $context)
    {
        if ($this->hasModule() && 'municipio' === $context) {
            return null;
        }
        
        return $pageData;
    }

    public function data() : array
    {
        $data = array();
        
        $theme = wp_get_theme('municipio');
        if ($theme->exists()) {
            $municipio = new \Municipio\Controller\BaseController;
            $breadcrumb = new \Municipio\Helper\Navigation('breadcrumb', 'modularity');
            $data['breadcrumbItems'] = $breadcrumb->getBreadcrumbItems($municipio->getPageID());
        }
        return $data;
    }

    /**
     * Available "magic" methods for modules:
     * init()            What to do on initialization
     * data()            Use to send data to view (return array)
     * style()           Enqueue style only when module is used on page
     * script            Enqueue script only when module is used on page
     * adminEnqueue()    Enqueue scripts for the module edit/add page in admin
     * template()        Return the view template (blade) the module should use when displayed
     */
}
{'fraction_non_alphanumeric': 0.11104294478527607, 'fraction_numerical': 0.0006134969325153375, 'mean_word_length': 2.4581124072110287, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4546145', 'n_tokens_mistral': 925, 'n_tokens_neox': 927, 'n_words': 265}