PluginProbe
Customize Admin / 1.3
Customize Admin v1.3
trunk 1.0 1.1 1.2 1.3 1.4 1.5 1.5.1 1.6 1.6.6 1.7 1.7.4 1.7.6 1.7.7 1.7.8 1.7.9 1.8.0 1.8.1 1.8.2 1.8.4 1.9.0 1.9.1 1.9.2 1.9.3 1.9.4 All 29 releases
customize-admin / customize-admin-options.php

customize-admin-options.php in Customize Admin 1.3, at customize-admin-options.php

85 lines 3.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // Create custom plugin settings menu
4 add_action('admin_menu', 'ca_create_menu');
5 function ca_create_menu() {
6
7 // Create a submenu page in the 'Settings' menu
8 add_submenu_page( 'options-general.php', 'Customize Admin', 'Customize Admin', 'manage_options', 'customize-admin/customize-admin-options.php', 'ca_settings_page');
9
10 // Call register settings function
11 add_action( 'admin_init', 'ca_register_settings' );
12 }
13
14 // Register the settings
15 function ca_register_settings() {
16 register_setting( 'customize-admin-settings-group', 'ca_logo_file' );
17 register_setting( 'customize-admin-settings-group', 'ca_logo_url' );
18 register_setting( 'customize-admin-settings-group', 'ca_remove_shadow' );
19 register_setting( 'customize-admin-settings-group', 'ca_remove_generator' );
20 }
21
22 // Include files for media uploader
23 function ca_admin_scripts() {
24 wp_enqueue_script('media-upload');
25 wp_enqueue_script('thickbox');
26 wp_register_script('my-upload', WP_PLUGIN_URL.'/customize-admin/customize-admin.js', array('jquery','media-upload','thickbox'));
27 wp_enqueue_script('my-upload');
28 }
29
30 function ca_admin_styles() {
31 wp_enqueue_style('thickbox');
32 }
33
34 // Only include media uploader scripts and styles on custmize options page
35 if (isset($_GET['page']) && $_GET['page'] == 'customize-admin/customize-admin-options.php') {
36 add_action('admin_print_scripts', 'ca_admin_scripts');
37 add_action('admin_print_styles', 'ca_admin_styles');
38 }
39
40 function ca_settings_page() { ?>
41 <div class="wrap">
42 <h2><?php _e('Customize Admin Options') ?></h2>
43 <form method="post" action="options.php">
44 <?php settings_fields( 'customize-admin-settings-group' ); ?>
45 <table class="form-table">
46 <tr valign="top">
47 <th scope="row"><?php _e('Custom Logo Link') ?></th>
48 <td><label for="ca_logo_url">
49 <input type="text" id="ca_logo_url" name="ca_logo_url" value="<?php echo get_option('ca_logo_url'); ?>" />
50 <br /><?php _e('If not specified, clicking on the logo will return you to the homepage.') ?>
51 </label>
52 </td>
53 </tr>
54 <tr valign="top">
55 <th scope="row"><?php _e('Custom Logo') ?></th>
56 <td><label for="upload_image">
57 <input id="upload_image" type="text" size="36" name="ca_logo_file" value="<?php echo get_option('ca_logo_file'); ?>" />
58 <input id="upload_image_button" type="button" value="Upload Image" />
59 <br /><?php _e('Enter a URL or upload an image for the image. Maximum height: 70px, width: 310px.') ?>
60 </label>
61 </td>
62 </tr>
63 <tr valign="top">
64 <th scope="row"><?php _e('Remove Admin Menu Shadow') ?></th>
65 <td><label for="ca_remove_shadow">
66 <input id="ca_remove_shadow" type="checkbox" name="ca_remove_shadow" value="1" <?php checked( '1', get_option( 'ca_remove_shadow' ) ); ?> />
67 <br /><?php _e('Selecting this option removes the shadow from the admin menu on the left.') ?>
68 </label>
69 </td>
70 </tr>
71 <tr valign="top">
72 <th scope="row"><?php _e('Remove Generator Meta Tag') ?></th>
73 <td><label for="ca_remove_generator">
74 <input id="ca_remove_generator" type="checkbox" name="ca_remove_generator" value="1" <?php checked( '1', get_option( 'ca_remove_generator' ) ); ?> />
75 <br /><?php _e('Selecting this option removes the generator meta tag from the html source.') ?>
76 </label>
77 </td>
78 </tr>
79 </table>
80 <p class="submit">
81 <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
82 </p>
83 </form>
84 </div>
85 <?php } ?>