WordPress.org

Make WordPress Core

Ticket #21598: wp-style-guide.php

File wp-style-guide.php, 1.2 KB (added by bootsz, 20 months ago)

First draft of a "style guide" plugin. Adds a new admin page with all button styles.

Line 
1<?php
2/*
3Plugin Name: WP Style Guide
4Plugin URI: http://make.wordpress.org/ui
5Description: Enables a Style Guide page showcasing various core button styles.
6Author: WordPress UI Group
7Author URI: http://make.wordpress.org/ui
8Version: 1.0
9*/
10
11/**
12 * Adds a tab "Style Guide" to the admin menu
13 */
14function style_guide_add_page() {
15        add_menu_page( 'Style Guide', 'Style Guide', 'add_users', 'wp-style-guide.php', 'style_guide_render_page');
16}
17add_action('admin_menu', 'style_guide_add_page');
18
19/**
20 * Renders the Style Guide page
21 */
22function style_guide_render_page() {
23        ?>
24        <div class="wrap">
25        <h2>Style Guide</h2>
26        <p>
27                <input type="submit" class="button-primary" value="Primary Button">
28                <input type="submit" class="button-primary button-primary-disabled" value="Primary Button Disabled">
29        </p>
30        <p>
31                <input type="submit" class="button" value="Regular Button">
32                <input type="submit" class="button button-disabled" value="Button Disabled">
33                <input type="submit" class="button-highlighted" value="Button Highlighted">
34        </p>
35        <p>
36                <input type="submit" class="button small" value="Small">
37                <input type="submit" class="button short" value="Short">
38                <input type="submit" class="button large" value="Large">
39
40        </p>
41        </div>
42
43
44        <?php
45}