Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Custom Post Type Archive Description Field
//http://wpsettingsapi.jeroensormani.com/
add_action( 'admin_menu', 'tsumtour_add_admin_menu' );
add_action( 'admin_init', 'tsumtour_settings_init' );
function tsumtour_add_admin_menu( ) {
add_submenu_page( 'edit.php?post_type=tour', 'Tour', 'Intro', 'manage_options', 'tour', 'tsumtour_options_page' );
}
function tsumtour_settings_init( ) {
register_setting( 'pluginPage', 'tsumtour_settings' );
add_settings_section(
'tsumtour_pluginPage_section',
__( 'Introduction', 'tsum_tour' ),
'tsumtour_settings_section_callback',
'pluginPage'
);
add_settings_field(
'tsumtour_textarea_field_0',
__( '', 'tsum_tour' ),
'tsumtour_textarea_field_0_render',
'pluginPage',
'tsumtour_pluginPage_section'
);
}
function tsumtour_textarea_field_0_render( ) {
$options = get_option( 'tsumtour_settings' );
?>
<textarea cols='80' rows='15' name='tsumtour_settings[tsumtour_textarea_field_0]'>
<?php echo $options['tsumtour_textarea_field_0']; ?>
</textarea>
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.