b96bc758 |
1 | <?php |
244ec72c |
2 | defined( 'ABSPATH' ) || die( 'No script kiddies please!' ); |
b96bc758 |
3 | /** |
4 | * Include settings options for our plugin |
5 | * @since 0.2 |
6 | */ |
8c3e9b00 |
7 | add_action( 'admin_menu', 'dnxcf_settings' ); |
b96bc758 |
8 | function dnxcf_settings() { |
8c3e9b00 |
9 | add_menu_page( 'danixland Contact Form Settings', __( 'Contact Form', 'dnxcf' ), 'manage_options', 'dnxcf_options', 'dnxcf_settings_display', 'dashicons-testimonial' ); |
b96bc758 |
10 | } |
11 | |
12 | /** |
13 | * The function that outputs our admin page |
14 | * @since 0.2 |
15 | */ |
16 | function dnxcf_settings_display() { |
8c3e9b00 |
17 | ?> |
18 | <div class="wrap"> |
19 | <h2><?php _e( 'danixland Contact Form Set up', 'dnxcf' ); ?></h2> |
20 | <form method="post" action="options.php"> |
21 | <?php |
22 | settings_fields( 'dnxcf_options' ); |
23 | do_settings_sections( 'dnxcf_options_sections' ); |
24 | ?> |
25 | <p class="submit"> |
26 | <input name="dnxcf_options[submit]" type="submit" class="button-primary" value="<?php esc_attr_e( 'Save Changes', 'dnxcf' ); ?>" /> |
27 | <input name="dnxcf_options[reset]" type="submit" class="button-secondary" value="<?php esc_attr_e( 'Reset Defaults', 'dnxcf' ); ?>" /> |
28 | </p> |
29 | </form> |
30 | </div> |
31 | <?php |
b96bc758 |
32 | } |
33 | |
34 | /** |
35 | * Settings API options initilization and validation |
36 | * @since 0.2 |
37 | */ |
38 | function dnxcf_register_options() { |
8c3e9b00 |
39 | require( dirname( __FILE__ ) . '/dnxcf_options-register.php' ); |
b96bc758 |
40 | } |
8c3e9b00 |
41 | add_action( 'admin_init', 'dnxcf_register_options' ); |