Make WordPress Core

Ticket #21598: buttons.6.php

File buttons.6.php, 2.0 KB (added by koopersmith, 14 years ago)
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 <h2><?php _e( 'Button Styles', 'buttons' ); ?></h2>
22
23 <?php //submit_button( $text, $type, $name, $wrap, $other_attributes ); ?>
24
25 <div style="float: left; width: 20%;">
26 <?php
27 submit_button('Primary', 'button-primary');
28 submit_button('Primary (hover)', 'button-primary hover');
29 submit_button('Primary (focus)', 'button-primary focus');
30 submit_button('Primary (active)', 'button-primary active');
31 submit_button('Primary (disabled)', 'button-primary', '', true, array('disabled' => 'disabled') );
32 ?>
33 </div>
34
35 <div style="float: left; width: 18%;">
36 <?php
37 submit_button('.button', 'button');
38 submit_button('.button (hover)', 'button hover');
39 submit_button('.button (focus)', 'button focus');
40 submit_button('.button (active)', 'button active');
41 submit_button('.button (disabled)', 'button', '', true, array('disabled' => 'disabled') );
42 ?>
43 </div>
44
45 <div class="clear"></div>
46 <h2><?php _e( 'Button Sizes', 'buttons' ); ?></h2>
47
48 <div style="float: left; width: 80px;">
49 <?php
50 submit_button('Large', 'button button-large', '' );
51 submit_button('Default', 'button', '' );
52 submit_button('Small', 'button button-small', '' );
53 submit_button('Tiny', 'button button-tiny', '' );
54 ?>
55 </div>
56
57 <div style="float: left; width: 80px;">
58 <?php
59 submit_button('Large', 'button button-primary button-large', '' );
60 submit_button('Default', 'button button-primary', '' );
61 submit_button('Small', 'button button-primary button-small', '' );
62 submit_button('Tiny', 'button button-primary button-tiny', '' );
63 ?>
64 </div>
65
66 </div><?php
67
68 }
69
70}