Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function programme_enable_pages() {
- add_submenu_page('edit.php?post_type=programmes', 'content', 'Archive content', 'edit_pages', basename(__FILE__), 'archiveContent');
- }
- add_action('admin_menu' , 'programme_enable_pages');
- function register_programme_settings() {
- register_setting( 'programme_content', 'programme_content' );
- register_setting( 'programme_content', 'programme_branding' );
- }
- add_action( 'admin_init', 'register_programme_settings' );
- function archiveContent() { ?>
- <div class="wrap">
- <form method="post" action="options.php">
- <?php
- settings_fields( 'programme_content' );
- do_settings_sections( 'programme_content' );
- wp_editor( get_option('programme_content'), 'programme_content', $settings = array('textarea_name'=>'programme_content') ); ?>
- <label><b>Branding options</b></label><br>
- <input type="radio" name="programme_branding" id="branding_blue" value="blueBranding" <?php checked('blueBranding', get_option('programme_branding'), true); ?> checked="checked">Blue Branding<br>
- <input type="radio" name="programme_branding" id="branding_red" value="redBranding" <?php checked('redBranding', get_option('programme_branding'), true); ?>/>Red Branding<br>
- <input type="radio" name="programme_branding" id="branding_orange" value="orangeBranding" <?php checked('orangeBranding', get_option('programme_branding'), true); ?>/>Orange Branding
- <?php submit_button(); ?>
- </form>
- </div>
- $capability = apply_filters( "option_page_capability_{$option_page}", $capability );
- add_filter( 'option_page_capability_programme_content', 'my_settings_permissions', 10, 1 );
- function my_settings_permissions( $capability ) {
- return 'edit_pages';
- }
Add Comment
Please, Sign In to add comment