Plugin Directory

Changeset 2140554


Ignore:
Timestamp:
08/16/2019 11:42:56 AM (7 years ago)
Author:
echelonso
Message:

Reinstated the visibility options

Location:
echelon-so/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • echelon-so/trunk/echelon-so.php

    r2140165 r2140554  
    44Plugin URI:     https://echelonso.com
    55Description:    Echelon widgets and features for SiteOrigin Page Builder.
    6 Version:        2.0.0
     6Version:        2.0.1
    77Author:         Echelon
    88Author URI:     https://echelonso.com
     
    9797            add_action( 'customize_controls_print_footer_scripts', array($this, 'admin_scripts'), 100);
    9898            add_action( 'admin_notices', array($this, 'admin_notices') );
     99            add_action( 'wp_head', array($this, 'wp_head'));
    99100        }
    100101
     
    104105
    105106        public function current_version() {
    106             return '2.0.0';
     107            return '2.0.1';
    107108        }
    108109
     
    474475        }
    475476
     477        /**
     478        * CSS for the header
     479        */
     480
     481        public function get_head_css() {
     482            global $echelon_so;
     483            ob_start();
     484            ?>
     485            <style type="text/css">
     486            @media only screen and (max-width: <?php echo $this->get_breakpoints()['mobile']; ?>) {
     487                .eso-hide-mobile {
     488                    display: none !important;
     489                }
     490            }
     491            @media only screen and (min-width: <?php echo $this->get_breakpoints()['mobile']; ?>) and (max-width: <?php echo $this->get_breakpoints()['tablet']; ?>){
     492                .eso-hide-tablet {
     493                    display: none !important;
     494                }
     495            }
     496            @media only screen and (min-width: <?php echo $this->get_breakpoints()['tablet']; ?>){
     497                .eso-hide-desktop {
     498                    display: none !important;
     499                }
     500            }
     501            </style>
     502            <?php
     503            $str = str_replace(array("\r","\n"),'',trim(ob_get_clean()));
     504            $str = str_replace("            ", ' ', $str);
     505            $str = str_replace("  ", ' ', $str);
     506            return $str;
     507        }
     508
     509        public function wp_head() {
     510            echo $this->get_head_css();
     511        }
     512
    476513    }
    477514
  • echelon-so/trunk/features/helper-css/helper-css.php

    r2140165 r2140554  
    5959            );
    6060
     61            $fields['echelonso_helper_css_show_desktop'] = array(
     62                'name'        => __( 'Desktop Visibility', 'echelon-so' ),
     63                'type'        => 'select',
     64                'group'       => 'echelonso_helper_css_group',
     65                'priority'    => 101,
     66                'default'     => '0',
     67                'options'     => array(
     68                    '0' => __('Show', 'echelon-so'),
     69                    'eso-hide-desktop' => __('Hide', 'echelon-so'),
     70                )
     71            );
     72
     73            $fields['echelonso_helper_css_show_tablet'] = array(
     74                'name'        => __( 'Tablet Visibility', 'echelon-so' ),
     75                'type'        => 'select',
     76                'group'       => 'echelonso_helper_css_group',
     77                'priority'    => 102,
     78                'default'     => '0',
     79                'options'     => array(
     80                    '0' => __('Show', 'echelon-so'),
     81                    'eso-hide-tablet' => __('Hide', 'echelon-so'),
     82                )
     83            );
     84
     85            $fields['echelonso_helper_css_show_mobile'] = array(
     86                'name'        => __( 'Mobile Visibility', 'echelon-so' ),
     87                'type'        => 'select',
     88                'group'       => 'echelonso_helper_css_group',
     89                'priority'    => 103,
     90                'default'     => '0',
     91                'options'     => array(
     92                    '0' => __('Show', 'echelon-so'),
     93                    'eso-hide-mobile' => __('Hide', 'echelon-so'),
     94                )
     95            );
     96
    6197            // text align - 110
    6298
     
    291327            }
    292328
     329            if ( !empty($style['echelonso_helper_css_show_desktop']) ) {
     330                $attributes['class'][] = $style['echelonso_helper_css_show_desktop'];
     331            }
     332
     333            if ( !empty($style['echelonso_helper_css_show_tablet']) ) {
     334                $attributes['class'][] = $style['echelonso_helper_css_show_tablet'];
     335            }
     336
     337            if ( !empty($style['echelonso_helper_css_show_mobile']) ) {
     338                $attributes['class'][] = $style['echelonso_helper_css_show_mobile'];
     339            }
     340
    293341            // text - 110
    294342
Note: See TracChangeset for help on using the changeset viewer.