You don’t. You would have to keep your new page in sync with the core file each time WordPress is updated … that would not be very pragmatic.
Hook into the do_settings_sections('general');
with register_setting()
and add your code here.
There is a third parameter for register_setting()
: you can register a callback function here which used before the value is saved to the database.
See the @Otto’s WordPress Settings API Tutorial for some examples. In one of my own plugins I do the same: Public Contact Data. See the method function add_contact_fields()
for details.
Related Posts:
- Some fields in Settings API form are saving, others are not
- wp-admin pages return ERR_EMPTY_RESPONSE
- Reorder custom submenu item
- WordPress custom permalinks not working on OS X localhost
- Add custom content in user-edit.php page
- 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
- How to Fix WordPress Not Saving Settings?
- How to display status messages in admin panel
- Options site set empty fields after submitting
- remove_query_arg on options.php
- I am not able to enable jQuery in theme settings
- Cannot Update wp DB – Get 500 Error
- Changing Admin Menu Labels
- Is there ANY way to remove comments function and section totally?
- Unit testing in the WordPress backend (is_admin() is true)
- How can I improve the line break handling in the WYSIWYG editor?
- How do I change the login logo URL and hover title?
- js error on post editing page
- How to add a custom metabox to the Menu Management admin screen?
- How to change the wording in wp-admin back-end?
- How to make ajax call in wordpress in right way?
- Only allow administrators and editors to access wp-admin
- Bulk Delete Users Error uri too large
- Custom plugin settings: clicking “save changes” does not display success message
- Can you change the main heading of a page in the WordPress admin (without output buffering or JavaScript)?
- Can’t output do_settings_sections . Can’t understand why
- Change the Return URL from the Customizer
- Where can I edit Admin Panel Page file
- how can I detect that option value has changed?
- How to display some settings for super admin user only using Settings API
- Performance of several get_option() calls
- Failed to load resource admin-ajax.php
- Additionally added URL params leading to “Invalid post type.” in the Admin Panel
- Custom WordPress Dashboard for Specific user role
- How to get bool with `get_option()` when already registered setting with type `boolean`
- 404 of wp-admin pages [closed]
- Remove Internal Style Sheet if no Value Provided?
- Execute script only on certain admin pages
- Detecting all admins that are logged in
- Sortable columns and admin like interface for tables/report in custom plugin?
- Remove favorites action menu and screen options panel
- No access local wordpress website after PC formating
- An update has caused my client’s site to be non-existent after new update of WordPress [closed]
- White screen of death in Dashboard after clean installation
- WordPress (admin) posts search GET request filter
- How can I replace dashboard.css and dashboard.min.css (not add new css)
- White screen of death for wp-admin and error for wp-login.php after entering credentials
- ‘wp’ hook supposed to trigger when editing a post?
- How to remove dashboard access (wp-admin) for author but not disable the capabilities?
- always by default show welcome panel in the dashboard
- Add and Remove Row Actions in an Existing WP_List_Table
- Dashboard Widget CSS
- Add styles to wordpress admin on the Page List
- making users.php search include a specific user meta data field without messing with the SQL query itself
- Move WooCommerce menu entries to top of dashboard
- “options.php” not found
- WordPress Admin Toolbar Disappeared when moved site to subfolder
- Admin sometimes redirects to HTTPS
- Hide user group filtering links
- 404 Admin Error
- auto generated robots.txt problem
- Change maxlength of link_description in dashbord link section?
- wordpress wp-admin/includes/shema.php file has been modify alone
- Broken Customizer page
- wp-admin going directly to 404
- Should I move wp-admin to a separated server? How to do it?
- WP-Admin throws 404 after changing wp-config Salts
- How to create a new section on the wordpress admin dashboard?
- What event I can tap into that fires before loading wp-admin page?
- How to fix the view of admin all posts
- WordPress Settings API Overrides My Previous Value
- mixed contents admin panel is Unsecured
- Link with password is not sent to the new user
- Can’t access Network Admin dashboard in wp-admin
- Can I rename the wp-admin folder?
- How do I list subpages in post editor view?
- Database problem
- WordPress Admin Page Redirecting to Subdomain
- Remove Theme menu link from Admin Panel
- Why does my edit screen suddenly have such a buggy interface?
- 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
- Option page not updating multiple records in settings api
- How to display product category’s individual product list in shop page?
- WordPress br in content problem
- Options don’t save, validation callback not executed
- wp-admin blank page after admin login and all security off
- Can a wordpress admin see my failed Login attempts?