admin_settings
Add the settings to the bbPress page in the Dashboard.
Description
admin_settings();
Usage
if ( !function_exists( 'admin_settings' ) ) { require_once ABSPATH . PLUGINDIR . 'bbpress-notify/bbpress-notify.php'; } // NOTICE! Understand what this does before running. $result = admin_settings();
Defined (1)
The function is defined in the following location(s).
- /bbpress-notify.php
- function admin_settings() {
- // Add section to bbPress options
- add_settings_section('bbpress_notify_options', __('E-mail Notifications', 'bbpress_notify'), '_settings_intro_text', 'bbpress');
- // Add form fields for all settings
- add_settings_field('bbpress_notify_newtopic_recipients', __('Notifications about new topics are sent to', 'bbpress_notify'), _topic_recipients_inputfield, 'bbpress', 'bbpress_notify_options');
- add_settings_field('bbpress_notify_newtopic_email_subject', __('E-mail subject', 'bbpress_notify'), _email_newtopic_subject_inputfield, 'bbpress', 'bbpress_notify_options');
- add_settings_field('bbpress_notify_newtopic_email_body', __('E-mail body (template tags: [blogname], [topic-title], [topic-content], [topic-excerpt], [topic-author], [topic-url], [topic-replyurl])', 'bbpress_notify'), _email_newtopic_body_inputfield, 'bbpress', 'bbpress_notify_options');
- add_settings_field('bbpress_notify_newreply_recipients', __('Notifications about replies are sent to', 'bbpress_notify'), _reply_recipients_inputfield, 'bbpress', 'bbpress_notify_options');
- add_settings_field('bbpress_notify_newreply_email_subject', __('E-mail subject', 'bbpress_notify'), _email_newreply_subject_inputfield, 'bbpress', 'bbpress_notify_options');
- add_settings_field('bbpress_notify_newreply_email_body', __('E-mail body (template tags: [blogname], [reply-title], [reply-content], [reply-excerpt], [reply-author], [reply-url], [reply-replyurl])', 'bbpress_notify'), _email_newreply_body_inputfield, 'bbpress', 'bbpress_notify_options');
- // Register the settings as part of the bbPress settings
- register_setting('bbpress', 'bbpress_notify_newtopic_recipients');
- register_setting('bbpress', 'bbpress_notify_newtopic_email_subject');
- register_setting('bbpress', 'bbpress_notify_newtopic_email_body');
- register_setting('bbpress', 'bbpress_notify_newreply_recipients');
- register_setting('bbpress', 'bbpress_notify_newreply_email_subject');
- register_setting('bbpress', 'bbpress_notify_newreply_email_body');
- }