Make WordPress Core

Ticket #21598: buttons-and-links.php

File buttons-and-links.php, 2.4 KB (added by azaozz, 12 years ago)

Tweaked test plugin to show input.button and a.button

Line 
1<?php
2/*
3Plugin Name: Button Styles
4*/
5
6global $button_styles;
7$button_styles = new Button_Styles();
8
9class Button_Styles {
10
11        function __construct() {
12                add_action( 'admin_menu', array( &$this, 'menu' ) );
13        }
14
15        function menu() {
16                add_management_page( __( 'Button Styles', 'buttons' ), __( 'Button Styles', 'buttons' ), 'edit_posts', __FILE__, array( &$this, 'page' ) );
17        }
18
19        function page() {
20                ?><div class="wrap">
21<!--
22                <h2><?php _e( 'Button Styles', 'buttons' ); ?></h2>
23
24                <?php //submit_button( $text, $type, $name, $wrap, $other_attributes ); ?>
25
26                <div style="float: left; width: 20%;">
27                        <?php
28                                submit_button('Primary', 'button-primary');
29                                submit_button('Primary (hover)', 'button-primary hover');
30                                submit_button('Primary (focus)', 'button-primary focus');
31                                submit_button('Primary (active)', 'button-primary active');
32                                submit_button('Primary (disabled)', 'button-primary', '',  true, array('disabled' => 'disabled') );
33                        ?>
34                </div>
35
36                <div style="float: left; width: 18%;">
37                        <?php
38                                submit_button('.button', 'button');
39                                submit_button('.button (hover)', 'button hover');
40                                submit_button('.button (focus)', 'button focus');
41                                submit_button('.button (active)', 'button active');
42                                submit_button('.button (disabled)', 'button', '',  true, array('disabled' => 'disabled') );
43                        ?>
44                </div>
45-->
46                <div class="clear"></div>
47                <h2><?php _e( 'Button Sizes', 'buttons' ); ?></h2>
48
49                <div style="float: left; width: 80px;">
50                        <p><input type="submit" class="button button-large" value="Large" /></p>
51                        <p><a href="#" class="button button-large">Large</a></p>
52                        <br>
53
54                        <p><input type="submit" class="button" value="Default" /></p>
55                        <p><a href="#" class="button">Default</a></p>
56                        <br>
57                       
58                        <p><input type="submit" class="button button-small" value="Small" /></p>
59                        <p><a href="#" class="button button-small">Small</a></p>
60                </div>
61
62                <div style="float: left; width: 80px;">
63                        <p><input type="submit" class="button button-primary button-large" value="Large" /></p>
64                        <p><a href="#" class="button button-primary button-large">Large</a></p>
65                        <br>
66
67                        <p><input type="submit" class="button button-primary" value="Default" /></p>
68                        <p><a href="#" class="button button-primary">Default</a></p>
69                        <br>
70                       
71                        <p><input type="submit" class="button button-primary button-small" value="Small" /></p>
72                        <p><a href="#" class="button button-primary button-small">Small</a></p>
73                </div>
74
75                </div><?php
76
77        }
78
79}