A few things to note in your code:
-
Two inputs share the same name of “email”, so when those values get sent in the form submission, the second one will overwrite the first.
-
The input
name
attribute value should match the name of the option being saved. Instead of “email”, use “fhwtest_email”. Without that, the values won’t be saved to the correct options. -
get_option()
will returnfalse
if there’s not a value set for the requested option name; if you passfalse
toesc_attr()
it’ll return an empty string, so the next save will set the value to an empty string.
While there are certainly lots of ways to approach the creation of settings, I suggest taking a look at the Plugin Developer’s Handbook section on Settings for sample code and details into the Settings and Options APIs.
Related Posts:
- wp-admin pages return ERR_EMPTY_RESPONSE
- Reorder custom submenu item
- WordPress custom permalinks not working on OS X localhost
- What is an “Options Framework” for WordPress
- WordPress address URL keeps dropping the www
- using wp_sprintf at wordpress option page,
- WordPress Options Page not working
- How to change user admin_color with WP CLI?
- Hide admin menu on update_option
- Custom plugin admin page issues
- Change admin defaults for reading settings
- unsuccessful attempt to change domains- wordpress re-routing to old domain
- Form input values are empty after submit
- Admin page changes the $_POST data
- Some fields in Settings API form are saving, others are not
- How to Fix WordPress Not Saving Settings?
- I am not able to enable jQuery in theme settings
- Cannot Update wp DB – Get 500 Error
- Creating your own options-general.php page
- Adding custom columns to custom post types
- Adding Fields to the Category, Tag and Custom Taxonomy Edit Screen in the WordPress Admin?
- Admin ajax request return 0 with die()
- How to remove comments option from wp-admin bar and modify profile icon
- Add header and footer to WP backend
- Edit specific nodes in WP_Admin_Bar
- Filter Custom Post Type in Admin
- Using Image insert control in code
- Wrong canonical link on wp-admin pages
- How can I make WordPress work with a Symfony app?
- Using the loop inside admin
- Easiest way to make post private by default
- Display sortable User meta column in admin panel user’s page
- Can’t access admin dashboard with wp-admin without /index.php after it
- How to change “wp-admin” to something else without search-replacing the core?
- Hooking into register_admin_color_schemes
- How can I add an extra admin column showing the word-count of a page or post?
- Which actions can update/change .php files?
- Blank page for edit.php
- Upload media file problem
- Always show same size tags for Tag Cloud in WordPress Admin
- Why should I password protect WP-Admin?
- How to change how long items are kept in the trash?
- Using /wp-admin works, using /login gives a 404. Why?
- Custom role based users are not able to access wp-admin
- How can I add ‘view mode’ to screen options for pages and cpts?
- Cannot log into WordPress Dashboard after removing/adding .htaccess
- My wp-admin stops working suddenly
- How to debug “You do not have sufficient permissions to access this page”? [closed]
- What is the practical difference between is_admin() and is_blog_admin()?
- How to check if upload window came from the featured image link?
- Today, without warning, all admin panel logins redirect to home page after login. non-admin users logins work well
- Stopping user deletion from running on error
- Admin search not working for any type of post
- admin_post action not usable if admin access denied to user
- Can’t log into wp-admin after migration from localhost to server
- Adding Custom Capabilites
- Why is unfiltered_upload not working despite being enabled?
- Can I add my own profile.php?
- Wp-admin is giving me an error “Sorry, you are not allowed to access this page.”. I do have access to the wp-admin besides the dashboard itself
- Add menu option to “New Post” menu in admin bar
- Linking table cells to network folders
- Remove bulk option row
- Admin menu in front-end
- Require Login Redirect to Login Page
- ASCII to Unicode conversion and then save the data into database using WP post editor field
- How to fix ob_end_flush() failed to send buffer of zlib output compression (1)?
- Delete the “wp-admin” folder – what could go wrong?
- How can I limit page parent dropdown to show only author’s own pages?
- Nickname field isn’t appearing in Admin
- How to Find The Email of a WP Admin Account
- how can I change the font on Edit Post area (admin dashboard)
- External HTTP API calls slowing down WordPress admin [closed]
- Creating custom admin panel pages without making a plugin?
- Why is my ‘export’ option missing?
- Change users.php WP_User_Query
- Blank page when viewing wp-admin
- Is it possible to display my theme sidebar in wordpress admin?
- wp-admin: “Sorry, you are not allowed to access this page.”
- How to access wordpress from domainB which is installed at domainA
- How to optimize the opening speed of admin panel?
- WordPress /wp-admin redirect to wrong port in docker
- How to change the URL of sub menu page?
- Change wordpress admin home page
- Strange wp admin edit buttons issue
- Cannot access wp-admin after migration to another place
- Regular users logs in as ADMIN if Admin logged in recently
- Enable Excerpt field inside the post editor for pages
- Failed to load resource: the server responded with a status of 500 (Internal Server Error)
- Strange Popup Ad on my WordPress Admin Dashboard
- WordPress switch domains
- Disabling WP-Admin Caching in htaccess
- Unable to log in as admin
- Add files to wordpress admin panel footer
- Can I rename the wp-admin folder?
- WordPress Child problem in admin
- SSL doesn’t deliver parts of WordPress Administration Module
- WordPress admin option, I can’t use jquery ajax to access my content from another file
- How to display product category’s individual product list in shop page?
- WordPress br in content problem
- How do I unset all of the select boxes for pages