| 1 | function writing_default_test_input_field() {
|
|---|
| 2 | echo '<input name="test_input_field" id="test_input_field" type="text" value="' . attribute_escape(get_option('test_input_field')) . '" size="40" />';
|
|---|
| 3 | }
|
|---|
| 4 |
|
|---|
| 5 | add_settings_field('test_input_field', 'Test Input Field', 'writing_default_test_input_field', 'writing', 'default', array('label_for' => 'test_input_field'));
|
|---|
| 6 | register_setting('writing', 'test_input_field', 'sanitize_title');
|
|---|
| 7 |
|
|---|
| 8 | function test_writing_section() {
|
|---|
| 9 | echo '<p>' . __('This is a new section on the writing settings page.') . '</p>';
|
|---|
| 10 | }
|
|---|
| 11 | add_settings_section('test_writing_section', 'Test Writing Section', 'test_writing_section', 'writing');
|
|---|
| 12 |
|
|---|
| 13 | function test_writing_section_input_field() {
|
|---|
| 14 | echo '<input name="section_test_input_field" id="section_test_input_field" type="text" value="' . attribute_escape(get_option('section_test_input_field')) . '" size="40" />';
|
|---|
| 15 | }
|
|---|
| 16 |
|
|---|
| 17 | add_settings_field('test_writing_section_input_field', 'Section Test Input Field', 'test_writing_section_input_field', 'writing', 'test_writing_section');
|
|---|
| 18 | register_setting('writing', 'section_test_input_field');
|
|---|