?> > <![endif]--> <!--[if (gt IE 9)|!(IE)]><!--><html class="no-js no-ie" <?php language_attributes(); ?> > <!--<![endif]--> <head> <meta charset="<?php bloginfo('charset'); ?> " /> <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" /> <!--[if lt IE 9]> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <script src="<?php echo Everything::getInstance()->template_uri; ?> /data/js/selectivizr.min.js"></script> <![endif]--> <?php wp_head(); ?> </head> <body <?php if (!is_null($background = Everything::io_('layout/background/background', 'general/background/background', '__hidden_ns', '__hidden'))) { if ($background instanceof \Drone\Options\Option\ConditionalTags) { $background = $background->option(); } echo $background->attrs(); } else {
/** * Theme options compatybility * * @since 1.7 * * @param array $data * @param string $version */ public function onThemeOptionsCompatybility(array &$data, $version) { // 1.7 if (version_compare($version, '1.7-alpha-3') < 0) { $conditional_tags_migrate = function ($data, $sidebars_widgets = false) { foreach ($_ = $data as $tag => $value) { if ($sidebars_widgets) { if (!preg_match('/^footer-(?P<tag>.+)-(?P<i>[0-5])$/', $tag, $footer_sidebar)) { continue; } $tag = $footer_sidebar['tag']; } $new_tag = false; if (preg_match('/^(post_type_|term_|bbpress|woocommerce)/', $tag)) { // new format continue; } else { if (in_array($tag, array('default', 'front_page', 'blog', 'search', '404'))) { // general continue; } else { if (in_array($tag, array('forum', 'topic'))) { // bbpress $new_tag = 'bbpress_' . $tag; } else { if (in_array($tag, array('shop', 'cart', 'checkout', 'order_received_page', 'account_page'))) { // woocommerce $new_tag = 'woocommerce_' . $tag; } else { if (strpos($tag, 'template_') === 0) { // template if (!preg_match('/.\\.php$/', $tag)) { foreach (array_keys(Everything::getInstance()->theme->get_page_templates()) as $template) { if ($tag == \Drone\Func::stringID('template_' . preg_replace('/\\.php$/i', '', $template), '_')) { $new_tag = 'template_' . preg_replace('/\\.(php)$/i', '_\\1', $template); break; } } } } else { if (preg_match('/^[_a-z]+_[0-9]+$/', $tag)) { // taxonomy if (preg_match('/^(portfolio_(category|tag)|topic_tag)_/', $tag)) { $new_tag = 'term_' . preg_replace('/_/', '-', $tag, 1); } else { $new_tag = 'term_' . $tag; } } else { if (preg_match('/^[_a-z]+$/', $tag)) { // post type $new_tag = 'post_type_' . $tag; } } } } } } } if ($new_tag !== false) { if ($sidebars_widgets) { $tag = $footer_sidebar[0]; $new_tag = "footer-{$new_tag}-{$footer_sidebar['i']}"; } unset($data[$tag]); $data[$new_tag] = $value; } } return $data; }; if (isset($data['general']['layout']) && is_array($data['general']['layout'])) { $data['general']['layout'] = $conditional_tags_migrate($data['general']['layout']); } if (isset($data['general']['max_width']) && is_array($data['general']['max_width'])) { $data['general']['max_width'] = $conditional_tags_migrate($data['general']['max_width']); } if (isset($data['general']['background']['background']) && is_array($data['general']['background']['background'])) { $data['general']['background']['background'] = $conditional_tags_migrate($data['general']['background']['background']); } if (isset($data['banner']['content']) && is_array($data['banner']['content'])) { $data['banner']['content'] = $conditional_tags_migrate($data['banner']['content']); } if (isset($data['nav']['secondary']['upper']) && is_array($data['nav']['secondary']['upper'])) { $data['nav']['secondary']['upper'] = $conditional_tags_migrate($data['nav']['secondary']['upper']); } if (isset($data['nav']['secondary']['lower']) && is_array($data['nav']['secondary']['lower'])) { $data['nav']['secondary']['lower'] = $conditional_tags_migrate($data['nav']['secondary']['lower']); } if (isset($data['nav']['headline']) && is_array($data['nav']['headline'])) { $data['nav']['headline'] = $conditional_tags_migrate($data['nav']['headline']); } if (isset($data['sidebar']['layout']) && is_array($data['sidebar']['layout'])) { $data['sidebar']['layout'] = $conditional_tags_migrate($data['sidebar']['layout']); } if (isset($data['footer']['layout']) && is_array($data['footer']['layout'])) { $data['footer']['layout'] = $conditional_tags_migrate($data['footer']['layout']); } if (($sidebars_widgets = get_option('sidebars_widgets')) !== false && is_array($sidebars_widgets)) { $new_sidebars_widgets = $conditional_tags_migrate($sidebars_widgets, true); if ($sidebars_widgets !== $new_sidebars_widgets) { update_option('sidebars_widgets', $new_sidebars_widgets); } } } }
protected function onShortcode($content, $code, \Drone\HTML &$html) { $everything = \Everything::getInstance(); // HTML $html = HTML::img()->class('icon')->alt(basename($this->so('name'))); // URI, width, height if (is_numeric($this->so('name'))) { if (($src = wp_get_attachment_image_src($this->so('name'), 'full')) === false) { return; } list($html->src, $html->width, $html->height) = $src; if (\Drone\Func::wpGetAttachmentID($src2x = preg_replace('/\\.(png|gif|jpe?g)$/i', '@2x.$1', $html->src)) !== false) { $html->data('image' . $html->width * 2, $src2x); } } else { if (!file_exists($everything->template_dir . '/data/img/icons/' . $this->so('name') . '.png')) { return; } if (($is = getimagesize($everything->template_dir . '/data/img/icons/' . $this->so('name') . '.png')) !== false) { list($html->width, $html->height) = $is; } else { $html->width = $html->height = 16; } $html->src = $everything->template_uri . '/data/img/icons/' . $this->so('name') . '.png'; if (file_exists($everything->template_dir . '/data/img/icons/' . $this->so('name') . '@2x.png')) { $html->data('image' . $html->width * 2, $everything->template_uri . '/data/img/icons/' . $this->so('name') . '@2x.png'); } } // Attributes if ($this->so('advanced/class')) { $html->addClass($this->so('advanced/class')); } if ($this->so('advanced/style')) { $html->style .= $this->so('advanced/style'); } }