Jetpack_Custom_CSS_Enhancements::revisions_switcher_box PHP Method

revisions_switcher_box() public static method

The HTML for the theme revision switcher box.
public static revisions_switcher_box ( string $stylesheet = '' )
$stylesheet string Stylesheet name.
    public static function revisions_switcher_box($stylesheet = '')
    {
        $themes = self::get_all_themes_with_custom_css();
        ?>
		<div class="other-themes-wrap">
			<label for="other-themes"><?php 
        esc_html_e('Select another theme to view its custom CSS.', 'jetpack');
        ?>
</label>
			<select id="other-themes">
				<option value=""><?php 
        esc_html_e('Select a theme&hellip;', 'jetpack');
        ?>
</option>
				<?php 
        foreach ($themes as $theme_stylesheet => $data) {
            $revisions = wp_get_post_revisions($data['post']->ID, array('posts_per_page' => 1));
            if (!$revisions) {
                ?>
						<option value="<?php 
                echo esc_url(add_query_arg('id', $data['post']->ID, menu_page_url('editcss', 0)));
                ?>
" <?php 
                disabled($stylesheet, $theme_stylesheet);
                ?>
>
							<?php 
                echo esc_html($data['label']);
                ?>
							<?php 
                printf(esc_html__('(modified %s ago)', 'jetpack'), human_time_diff(strtotime($data['post']->post_modified_gmt)));
                ?>
</option>
						<?php 
                continue;
            }
            $revision = array_shift($revisions);
            ?>
					<option value="<?php 
            echo esc_url(get_edit_post_link($revision->ID));
            ?>
" <?php 
            disabled($stylesheet, $theme_stylesheet);
            ?>
>
						<?php 
            echo esc_html($data['label']);
            ?>
						<?php 
            printf(esc_html__('(modified %s ago)', 'jetpack'), human_time_diff(strtotime($data['post']->post_modified_gmt)));
            ?>
</option>
					<?php 
        }
        ?>
			</select>
			<button class="button" id="other_theme_custom_css_switcher"><?php 
        esc_html_e('Switch', 'jetpack');
        ?>
</button>
		</div>
		<?php 
    }