$themes = array(); $wp_themes = get_site_transient('rollback_themes'); $rollbacks = $wp_themes->response; foreach ($prepared_themes as $key => $value) { $themes[$key] = $prepared_themes[$key]; $themes[$key]['hasRollback'] = isset($rollbacks[$key]); } return $themes; } } } // End if class_exists check /** * The main function responsible for returning the one true WP Rollback * Instance to functions everywhere. * * Use this function like you would a global variable, except without needing * to declare the global. * * Example: <?php $wp_rollback = WP_Rollback(); ?> * * @since 1.0 * @return object The one true WP Rollback Instance */ function WP_Rollback() { return WP_Rollback::instance(); } // Get WP Rollback Running WP_Rollback();
<p><?php echo apply_filters('wpr_rollback_description', sprintf(__('Please select which %1$s version you would like to rollback to from the releases listed below. You currently have version %2$s installed of %3$s.', 'wpr'), '<span class="type">' . ($theme_rollback == true ? __('theme', 'wpr') : __('plugin', 'wpr')) . '</span>', '<span class="current-version">' . esc_html($args['current_version']) . '</span>', '<span class="rollback-name">' . esc_html($args['rollback_name']) . '</span>')); ?> </p> </div> <?php if (isset($args['plugin_file']) && in_array($args['plugin_file'], array_keys($plugins))) { $versions = WP_Rollback()->versions_select('plugin'); } elseif ($theme_rollback == true && isset($_GET['theme_file'])) { //theme rollback: set up our theme vars $svn_tags = WP_Rollback()->get_svn_tags('theme', $_GET['theme_file']); $this->set_svn_versions_data($svn_tags); $this->current_version = $_GET['current_version']; $versions = WP_Rollback()->versions_select('theme'); } else { //Fallback check wp_die('Oh no! We\'re missing required rollback query strings. Please contact support so we can check this bug out and squash it!', 'wpr'); } ?> <form name="check_for_rollbacks" class="rollback-form" action="<?php echo admin_url('/index.php'); ?> "> <?php //Output Versions if (!empty($versions)) { ?>