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
- Organizing Code in your WordPress Theme's functions.php File?
- How to check if a user is in a specific role?
- Can I rename the wp-admin folder?
- How do I Enqueue styles/scripts on Certain /wp-admin Pages?
- Changing Admin Menu Labels
- Adding custom columns to custom post types
- Adding Fields to the Category, Tag and Custom Taxonomy Edit Screen in the WordPress Admin?
- adding custom stylesheet to wp-admin
- Can’t change language (only “English (United States)”)
- Is there ANY way to remove comments function and section totally?
- Add multiple custom fields to the general settings page
- How to use “menu_order” field for posts?
- “Too many redirects” ONLY when trying to access wp-admin page
- How to restrict dashboard access to Admins only?
- “Error: Options Page Not Found” on Settings Page Submission for an OOP Plugin
- How to pass arguments from add_settings_field() to the callback function?
- Admin Page Redirect
- Disable dragging of meta boxes?
- Toggle admin metabox based upon chosen page template
- Is get_option function cached?
- Unable to login and wp-login.php redirects to wp-admin%2F&reauth=1?
- When moving a WP site, why does wp-admin redirect to old site?
- How to pass variable to add_settings_section() callback?
- How to disable the “Post Lock/Edit Lock”?
- adding the category to the admin column for a custom post type?
- How can we make managing lots of pages in WordPress Admin better?
- Change page title in admin area
- do_shortcode() within Admin Page
- How can I control the position in the admin menu of items added by plugins?
- What are the advantages to the Settings API?
- Changing the ‘wp-admin’ URL to whatever I want
- Where to store plugin settings fields
- Unit testing in the WordPress backend (is_admin() is true)
- Admin ajax request return 0 with die()
- How to prevent access to wp-admin for certain user roles?
- How to remove screen options and help links in the admin area?
- How to remove the core embed blocks in WordPress 5.6?
- How to increase the file size limit for media uploads?
- Create WP tutorial for users with admin pointer using next button for navigation
- I’m getting a 404 message when I try to access wpadmin
- Taxonomy dropdown metabox in the back-end
- wordpress wp-admin css not loading
- Sort admin menu items
- How to order by post meta name in wp admin?
- How set defaults on wpLink()
- Remove dashboard, use Pages tab as default
- WordPress Settings API, Implementing Tabs On Custom Menu Page
- How to redirect/rewrite all /wp-login requests
- Show all post tags on post edit screen/sidebox
- How to hook in and modify the new revisions UI (3.6+)?
- How to display a static HTML page while setting up a WordPress site?
- Limit widget to certain sidebar?
- How can I uninstall a language?
- Check if user is admin by user ID
- My wordpress site gets redirected automatically to the old site any known solution for this?
- Best way to present options for home page in admin?
- Use a different domain for SSL
- Remove specific items from Quick Edit menu of a Custom Post Type?
- How to filter by post-format in admin?
- Unable to login to my wordpress site. reauth=1 redirection loop
- Add “external” link to admin menu in the backend
- Difference between Option_Group and Option_Name in Register_Settings
- How to Layer 7 Load Balance WordPress Backend and Frontend?
- Disable image attachment links
- How can I improve the line break handling in the WYSIWYG editor?
- wp_list_tables bulk actions
- Custom column for changing post status via ajax
- How do I change the login logo URL and hover title?
- Custom login redirects to wp-admin on wrong password
- How to remove comments option from wp-admin bar and modify profile icon
- What’s the best method for emptying an option created with the Settings API?
- Remove “Time to upgrade” message from dashboard
- Add header and footer to WP backend
- js error on post editing page
- How to search post by ID in wp-admin
- Remove ‘Custom..’ option in tinyMCE colour swatch
- sortable custom column in media library
- Settings API – easiest way of validating checkboxes?