ru-se.com

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

ThemeSupport.php (1127B)


      1 <?php
      2 
      3 namespace Materialis\Customizer;
      4 
      5 class ThemeSupport {
      6     private static $defaultSupport = array();
      7 
      8     private static $defaultsReady = false;
      9     private static function setDefault() {
     10 
     11         if (self::$defaultsReady) {
     12             return;
     13         }
     14 
     15         self::$defaultsReady = true;
     16 
     17         $companion            = \Materialis\Companion::instance();
     18         self::$defaultSupport = array(
     19             'custom-background' => array(
     20                 'default-color'      => "#F5FAFD",
     21 //                'default-image'      => $companion->themeDataURL() . "/sections/images/Travel_through_New_York_wallpaper-1920x1200.jpg",
     22                 'default-repeat'     => 'no-repeat',
     23                 'default-position-x' => 'center',
     24                 'default-attachment' => 'fixed',
     25             ),
     26         );
     27     }
     28 
     29     public static function load() {
     30         self::setDefault();
     31 
     32         $supports = apply_filters('cloudpress\theme_support', static::$defaultSupport);
     33 
     34         foreach ($supports as $key => $value) {
     35             add_theme_support($key, $value);
     36         }
     37     }
     38 }