library/Widget/Source/HeaderWidget.php
protected function visibilityClasses()
    {
        if (!$this->get_field('widget_header_visibility') || !is_array($this->get_field('widget_header_visibility')) || empty($this->get_field('widget_header_visibility'))) {
            return false;
        }

        $options = array(
            'xs' => 'hidden-xs',
            'sm' => 'hidden-sm',
            'md' => 'hidden-md',
            'lg' => 'hidden-lg'
        );

        $options = apply_filters('Municipio/Widget/Source/NavigationWidget/visibilityClasses', $options);

        $classes = array();

        foreach ($this->get_field('widget_header_visibility') as $device) {
            if (isset($options[$device])) {
                $classes[] = $options[$device];
            }
        }

        if (!empty($classes)) {
            $this->data['widgetWrapperClass'] = array_merge($this->data['widgetWrapperClass'], $classes);

            return true;
        }

        return false;
    }
protected function visibilityClasses()
    {
        if (!$this->get_field('widget_header_visibility') || !is_array($this->get_field('widget_header_visibility')) || empty($this->get_field('widget_header_visibility'))) {
            return false;
        }

        $options = array(
            'xs' => 'hidden-xs',
            'sm' => 'hidden-sm',
            'md' => 'hidden-md',
            'lg' => 'hidden-lg'
        );

        $options = apply_filters('Municipio/Widget/Source/NavigationWidget/visibilityClasses', $options);

        $classes = array();

        foreach ($this->get_field('widget_header_visibility') as $device) {
            if (isset($options[$device])) {
                $classes[] = $options[$device];
            }
        }

        if (!empty($classes)) {
            $this->data['widgetWrapperClass'] = array_merge($this->data['widgetWrapperClass'], $classes);

            return true;
        }

        return false;
    }
protected function visibilityClasses ( ) { if ( ! $ this -> get_field ( 'widget_header_visibility' ) || ! is_array ( $ this -> get_field ( 'widget_header_visibility' ) ) || empty ( $ this -> get_field ( 'widget_header_visibility' ) ) ) { return false ; } $ options = array ( 'xs' => 'hidden-xs' , 'sm' => 'hidden-sm' , 'md' => 'hidden-md' , 'lg' => 'hidden-lg' ) ; $ options = apply_filters ( 'Municipio/Widget/Source/NavigationWidget/visibilityClasses' , $ options ) ; $ classes = array ( ) ; foreach ( $ this -> get_field ( 'widget_header_visibility' ) as $ device ) { if ( isset ( $ options [ $ device ] ) ) { $ classes [ ] = $ options [ $ device ] ; } } if ( ! empty ( $ classes ) ) { $ this -> data [ 'widgetWrapperClass' ] = array_merge ( $ this -> data [ 'widgetWrapperClass' ] , $ classes ) ; return true ; } return false ; }
Method to add visibility classes to widget wrapper based on ACF field
@return void
Method to add visibility classes to widget wrapper based on ACF field