foreach ($fields as $field => $regex) {
                if (preg_match('/^[ \\t\\/*#@]*' . preg_quote($regex, '/') . ':(.*)$/mi', $body, $match) && $match[1]) {
                    $all_headers[$field] = strip_tags(_cleanup_header_comment($match[1]));
                } else {
                    $all_headers[$field] = '';
                }
            }
            return $all_headers;
        }
        /**
         * Display an admin notice about next steps
         */
        function admin_notice()
        {
            if (!get_option('siteorigin_installer_admin_notice')) {
                ?>
				<div class="updated">
					<p>
						<?php 
                printf(__("<strong>SiteOrigin Installer</strong> is ready. Start installing %s and %s to get your site going.", 'siteorigin-installer'), '<a href="' . admin_url('admin.php?page=siteorigin-themes-installer') . '">' . __('themes', 'siteorigin-installer') . '</a>', '<a href="' . admin_url('admin.php?page=siteorigin-plugins-installer') . '">' . __('plugins', 'siteorigin-installer') . '</a>');
                ?>
					</p>
				</div>
				<?php 
                add_option('siteorigin_installer_admin_notice', true, '', false);
            }
        }
    }
}
SiteOrigin_Installer::single();
Esempio n. 2
0
						<div class="buttons">
							<?php 
    if ($theme->errors()) {
        ?>
								<a href="<?php 
        echo wp_nonce_url($install_url, 'siteorigin-install-theme');
        ?>
" class="button-secondary"><?php 
        _e('Install', 'siteorigin-installer');
        ?>
</a>
							<?php 
    } elseif ($theme->get_stylesheet() != $current_theme->get_stylesheet()) {
        ?>
								<a href="<?php 
        echo SiteOrigin_Installer::single()->get_activation_url($slug);
        ?>
" class="button-secondary"><?php 
        _e('Activate', 'siteorigin-installer');
        ?>
</a>
							<?php 
    }
    ?>
							<a href="<?php 
    echo esc_url($theme_data['demo']);
    ?>
" target="_blank" class="button-primary siteorigin-demo"><?php 
    _e('Demo', 'siteorigin-installer');
    ?>
</a>
 function theme_headers_action()
 {
     if (empty($_GET['_sononce']) || !wp_verify_nonce($_GET['_sononce'], 'theme_info')) {
         exit;
     }
     if (empty($_GET['theme_slug']) || empty($_GET['theme_version'])) {
         exit;
     }
     // header('content-type: application/json');
     $data = SiteOrigin_Installer::single()->get_theme_data($_GET['theme_slug'], $_GET['theme_version']);
     echo json_encode($data);
     exit;
 }