Plugin Directory

Changeset 587260


Ignore:
Timestamp:
08/18/2012 11:31:20 PM (14 years ago)
Author:
simpleux
Message:

Added WordPress child theme support

File:
1 edited

Legend:

Unmodified
Added
Removed
  • layout-engine/trunk/lesscss_admin.php

    r585085 r587260  
    283283        $options_saved = get_option('layout_manager_theme_options', array());
    284284       
    285         $stylesheet_path = get_template_directory().DS.'style.less';
    286         if(file_exists($stylesheet_path))
     285        //Child theme support
     286        $stylesheet_path = get_stylesheet_directory().DS.'style.less';
     287        if(!$wp_filesystem->exists($stylesheet_path ))
     288        {
     289            $stylesheet_path = get_template_directory().DS.'style.less';
     290        }
     291       
     292        if($wp_filesystem->exists($stylesheet_path ))
    287293        {
    288294                       
     
    595601       
    596602       
    597         $stylesheet_path = get_template_directory().DS.'style.less';
    598         if(file_exists($stylesheet_path))
     603        //Child theme support
     604        $stylesheet_path = get_stylesheet_directory().DS.'style.less';
     605        if(!$wp_filesystem->exists($stylesheet_path ))
     606        {
     607            $stylesheet_path = get_template_directory().DS.'style.less';
     608        }
     609       
     610        if($wp_filesystem->exists($stylesheet_path ))
    599611        {
    600612            $settings = (array) LE_LESSCSS_Admin::getSettings();
     
    639651           
    640652            //Compiling stylesheet
    641             $stylesheet_path = get_template_directory().DS.'style.css';
     653            $stylesheet_path = str_replace(".less",".css",$stylesheet_path);
    642654            return $wp_filesystem->put_contents($stylesheet_path, $less_css_compiled);
    643655        }
Note: See TracChangeset for help on using the changeset viewer.