Plugin Directory

Changeset 2087017


Ignore:
Timestamp:
05/13/2019 03:37:53 PM (7 years ago)
Author:
fayne
Message:

Options page added

File:
1 edited

Legend:

Unmodified
Added
Removed
  • be-lazy/trunk/app/Controllers/Frontend.php

    r2087009 r2087017  
    77        public function __construct()
    88        {
    9             switch(get_option(BE_LAZY_SLUG_DB .'_active'))
     9            if($this->is_active())
     10            {
     11                add_action('wp_enqueue_scripts', [$this, 'enqueue_styles']);
     12                add_action('wp_enqueue_scripts', [$this, 'enqueue_scripts']);
     13                add_filter('the_content', [$this, 'filter_content'], 100);
     14            }
     15        }
     16
     17        public function is_active()
     18        {
     19            switch(get_option(BE_LAZY_SLUG_DB .'_active'))
    1020            {
    1121                case '0':
     22                    return false;
    1223                case '1':
    13                     add_action('wp_enqueue_scripts', [$this, 'enqueue_styles']);
    14                     add_action('wp_enqueue_scripts', [$this, 'enqueue_scripts']);
    15                     add_filter('the_content', [$this, 'filter_content'], 100);
    16                     break;
     24                    return true;
     25                case '2':
     26                    // TODO: return boolean (current page manually selected?)
     27                default:
     28                    return false;
    1729            }
    18         }
     30        }
    1931
    2032        public function enqueue_styles()
Note: See TracChangeset for help on using the changeset viewer.