function repair_child_theme()
 {
     $parent_theme_path = get_template_directory();
     $child_theme_path = get_stylesheet_directory();
     if ($parent_theme_path == $child_theme_path) {
         return;
     }
     $functions_file_content = file_get_contents("{$child_theme_path}/functions.php");
     $updated_content = preg_replace('/\\bbuilder_add_scripts\\b/', 'builder_child_theme_add_scripts', $functions_file_content);
     if ($functions_file_content != $updated_content) {
         if (false === $this->update_file("{$child_theme_path}/functions.php", $updated_content)) {
             ITError::admin_warn('unable_to_update_child_theme', __('In order for Builder to function properly, the child theme must have its <code>builder_add_scripts</code> function (and all references to that function, such as in <code>add_action</code> function calls) replaced with a new name such as <code>builder_child_theme_add_scripts</code>. Builder attempted to do this automatically, but it was unable to do so. This is likely due to file permissions. Either fix the file permissions so that Builder can handle this fix automatically or update your child theme\'s <code>functions.php</code> file manually.', 'it-l10n-Builder-Madison'));
         }
         return;
     }
 }
Exemplo n.º 2
0
 function __validate_config()
 {
     if (!function_exists('get_post_type_object')) {
         return false;
     }
     if (empty($this->_var)) {
         it_classes_load('it-error.php');
         ITError::admin_warn('it-post-type-missing-var', "Unable to load {$this->_class} due to missing _var.", 'edit_plugins');
         return false;
     }
     if (empty($this->_file)) {
         it_classes_load('it-error.php');
         ITError::admin_warn('it-post-type-missing-file', "Unable to load {$this->_class} due to missing _file.", 'edit_plugins');
         return false;
     }
     return true;
 }
Exemplo n.º 3
0
 function render_sidebar_block_contents($fields, $side)
 {
     $data = $fields['data'];
     if ('none' === $data['sidebar']) {
         return;
     }
     if (empty($data['sidebar_widths'])) {
         ITError::admin_warn('empty_var:parameter:data[\'sidebar_widths\']', __('Unable to decide widths due to missing sidebar_widths value.', 'it-l10n-Builder-Cohen'));
     }
     $name = $this->_get_sidebar_name($fields['layout'], $fields['guid'], $data);
     if (method_exists($this, '_render_sidebar_block_contents')) {
         $this->_render_sidebar_block_contents($fields, $side, $name);
     }
     if (true === $this->_has_sidebars && !empty($data['sidebar'])) {
         if ("2_{$side}" === $data['sidebar']) {
             echo "<div class='widget-outer-wrapper widget-outer-wrapper-top'>\n";
             $this->_render_sidebar($fields, "{$name} - Top", array('class' => array('widget-wrapper', 'widget-wrapper-single', 'widget-wrapper-top', 'single', 'widget-wrapper-1', 'clearfix')));
             echo "</div>\n";
             echo "<div class='widget-section-wrapper clearfix'>\n";
             echo "<div class='widget-outer-wrapper widget-outer-wrapper-left'>\n";
             $this->_render_sidebar($fields, "{$name} - Left", array('class' => array('widget-wrapper', 'widget-wrapper-left', 'left', 'widget-wrapper-1', 'clearfix')));
             echo "</div>\n";
             echo "<div class='widget-outer-wrapper widget-outer-wrapper-right'>\n";
             $this->_render_sidebar($fields, "{$name} - Right", array('class' => array('widget-wrapper', 'widget-wrapper-right', 'right', 'widget-wrapper-2', 'clearfix')));
             echo "</div>\n";
             echo "</div>\n";
             echo "<div class='widget-outer-wrapper widget-outer-wrapper-bottom'>\n";
             $this->_render_sidebar($fields, "{$name} - Bottom", array('class' => array('widget-wrapper', 'widget-wrapper-single', 'widget-wrapper-bottom', 'single', 'widget-wrapper-1', 'clearfix')));
             echo "</div>\n";
         } else {
             if (preg_match("/^(1_{$side}|split)\$/", $data['sidebar'])) {
                 if ('left' === $side) {
                     $width = $this->_widths['sidebar_widths'][0];
                 } else {
                     $width = '1_right' === $data['sidebar'] ? $this->_widths['sidebar_widths'][0] : $this->_widths['sidebar_widths'][1];
                 }
                 $this->_render_sidebar($fields, "{$name} - " . ucfirst($side), array('class' => array('widget-wrapper', 'widget-wrapper-single', 'single', 'widget-wrapper-1', 'clearfix')));
             }
         }
     }
 }