| 1 | <?php |
| 2 | defined( 'ABSPATH' ) || die( 'No script kiddies please!' ); |
| 3 | /** |
| 4 | * Include settings options for our plugin |
| 5 | * @since 0.2 |
| 6 | */ |
| 7 | add_action( 'admin_menu', 'dnxcf_settings' ); |
| 8 | function dnxcf_settings() { |
| 9 | add_menu_page( 'danixland Contact Form Settings', __( 'Contact Form', 'dnxcf' ), 'manage_options', 'dnxcf_options', 'dnxcf_settings_display', 'dashicons-testimonial' ); |
| 10 | } |
| 11 | |
| 12 | /** |
| 13 | * The function that outputs our admin page |
| 14 | * @since 0.2 |
| 15 | */ |
| 16 | function dnxcf_settings_display() { |
| 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 |
| 32 | } |
| 33 | |
| 34 | /** |
| 35 | * Settings API options initilization and validation |
| 36 | * @since 0.2 |
| 37 | */ |
| 38 | function dnxcf_register_options() { |
| 39 | require( dirname( __FILE__ ) . '/dnxcf_options-register.php' ); |
| 40 | } |
| 41 | add_action( 'admin_init', 'dnxcf_register_options' ); |