Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /* ========================================================================================================================
- Custom Admin Menu
- ======================================================================================================================== */
- add_action( 'admin_menu', 'site_options_menu' );
- function site_options_menu() {
- add_menu_page( 'Company Info', 'Company Info', 'manage_options', 'company-info-options', 'site_options' );
- }
- add_action('admin_init', 'register_settings');
- function register_settings() {
- register_setting('settings-group','phonenumber');
- register_setting('settings-group','primaryemail');
- register_setting('settings-group','secondemail');
- register_setting('settings-group','address1');
- register_setting('settings-group','address2');
- register_setting('settings-group','address3');
- register_setting('settings-group','address4');
- register_setting('settings-group','town');
- register_setting('settings-group','postcode');
- register_setting('settings-group','facebook');
- register_setting('settings-group','twitter');
- register_setting('settings-group','linkedin');
- register_setting('settings-group','googleplus');
- register_setting('settings-group','pinterest');
- }
- function site_options()
- {
- ?>
- <div class="wrap">
- <h2>Company Options</h2>
- <p>This is where some global information about your company is stored. You can add information here to be used across the site.</p>
- <form method="post" action="options.php">
- <p><input type="submit" value="Save" class="button-primary" /></p>
- <fieldset style="border: 1px solid #ccc !important;padding: 10px !important;"><legend>Contact Information</legend>
- <p><strong>Phone Number:</strong><br />
- <input type="text" name="phonenumber" size="45" value="<?php echo get_option('phonenumber'); ?>" />
- </p>
- <p><strong>Primary Email:</strong><br />
- <input type="text" name="primaryemail" size="45" value="<?php echo get_option('primaryemail'); ?>" />
- <br /><small>This is the email that will be used first, when only one contact email is output</small>
- </p>
- <p><strong>Secondary Email:</strong><br />
- <input type="text" name="secondemail" size="45" value="<?php echo get_option('secondemail'); ?>" />
- </p>
- </fieldset>
- <br />
- <fieldset style="border: 1px solid #ccc !important;padding: 10px !important;"><legend>Address</legend>
- <p><strong>Line 1:</strong><br />
- <input type="text" name="address1" size="45" value="<?php echo get_option('address1'); ?>" />
- </p>
- <p><strong>Line 2:</strong><br />
- <input type="text" name="address2" size="45" value="<?php echo get_option('address2'); ?>" />
- </p>
- <p><strong>Line 3:</strong><br />
- <input type="text" name="address3" size="45" value="<?php echo get_option('address3'); ?>" />
- </p>
- <p><strong>Line 4:</strong><br />
- <input type="text" name="address4" size="45" value="<?php echo get_option('address4'); ?>" />
- </p>
- <p><strong>Town:</strong><br />
- <input type="text" name="town" size="45" value="<?php echo get_option('town'); ?>" />
- </p>
- <p><strong>Postcode:</strong><br />
- <input type="text" name="postcode" size="45" value="<?php echo get_option('postcode'); ?>" />
- </p>
- </fieldset>
- <br />
- <fieldset style="border: 1px solid #ccc !important;padding: 10px !important;"><legend>Social Accounts</legend>
- <small>Please include http://www. at the beginning of the link</small><br/>
- <p><strong>Facebook:</strong><br />
- <input type="text" name="facebook" size="45" value="<?php echo get_option('facebook'); ?>" />
- </p>
- <p><strong>Twitter:</strong><br />
- <input type="text" name="twitter" size="45" value="<?php echo get_option('twitter'); ?>" />
- </p>
- <p><strong>LinkedIn:</strong><br />
- <input type="text" name="linkedin" size="45" value="<?php echo get_option('linkedin'); ?>" />
- </p>
- <p><strong>Google+:</strong><br />
- <input type="text" name="googleplus" size="45" value="<?php echo get_option('googleplus'); ?>" />
- </p>
- <p><strong>Pinterest:</strong><br />
- <input type="text" name="pinterest" size="45" value="<?php echo get_option('pinterest'); ?>" />
- </p>
- </fieldset>
- <p><input type="submit" value="Save" class="button-primary" /></p>
- </form>
- </div>
- <?php } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement