You only need to register one setting and then just modify your form inputs to save the values into an array. Here’s an example of registering the setting:
register_setting(
'mytheme_settings',
'mytheme_settings',
'admin_options_sanitize'
);
$mytheme_settings = get_option( 'mytheme_settings' );
and the field markup:
<textarea name="mytheme_settingsAdmin Options page. Save as Array">
<?php echo esc_textarea( $mytheme_settings['title'] ); ?>
</textarea>
You’ll also need to combine your sanitize functions, modifying them to work with the values in the new array.
Related Posts:
- Get categories names as an array to use it in theme settings
- Building a WordPress App
- Alter required message using comment form api
- Advanced Custom Fields – display label and value only if value entered
- meaning of (array)function()
- Grouping posts by a custom meta value
- How can I open up my administrative panel to everyone?
- wp_force_remove_style’ not found
- How to fix this warning:call_user_func_array() expects exactly 2 parameters, 1 given in D:\wamp\www\…….\wp-includes\class-wp-hook.php on line 286
- How can I access string value in an array?
- How to use if statement in an array? [closed]
- How to array only one key from another array
- Filtering a function’ output for a new continued function
- Get html data with javascript to php array and store to wordpress database
- How do I create a numbered list with PHP? [closed]
- Why is an array created in a function hooked to customize register populated when customizer is loaded but not when the front-end is loaded?
- How to use array in function to get only value I want
- retain querystring values when savincustom options in admin
- Error while setting role
- Get Page ID from Backend
- How to get the last category name of a child category?
- How to say if meta_value is greater than 0 in an array?
- How to use two meta_compare in an array?
- Warning: in_array() null given in PHP function
- Foreach loop inside an array_merge
- Loop over Array and get the distinct ids
- How to access or parse key/values that have “string”
- If Array Values Match Another Array’s Values, Then
- Remove empty terms from array, sort alphabetically, update back to repeating field
- WordPress loop by meta key that is an array? and how loop multiple arrays
- Can not add admin notices from the edit_user_profile_update hook (notices not being displayed)?
- Only show first image in foreach loop
- Conditional multidimensional arrays and array_map
- How can I get all values from my array in a loop in php? [closed]
- Getting posts to exclude from array
- Get all posts as an array ID => Name
- I’m unable to call img path using single quotes in an array?
- Filter by field with array value in ACF on WP REST API
- extract serialized array to use for wp-query
- get users search not working with array
- Comapare get_user_meta value
- How can get all users by current user meta?
- Get the id of all images in a post
- Output category list inside array
- how to make an array of post id’s in is_single
- How can I split my query result in 2 arrays?
- Multidimensional Array
- Separate array output into a
- array_rand not working correctly?
- Get css class of menu item in custom menu structure
- Removing custom sort order from admin page listing
- I installed WordPress locally now how do I login?
- Dynamically adding filters
- Order a WP_Query by meta value where the value is an array
- Only load certain artists on this page
- add the value of a variable returned in a while loop [closed]
- Update value of a associative array with update_post_meta
- How to make sure relative URL works when site is not on root domain?
- Get URI from PodPress using PHP
- How To Pass Array To get_the_category_by_ID() and Get An Array Back?
- using images in next/previous_post_link [closed]
- Finding and removing duplicates within WP Arrays
- Adding a ‘style=’ bit to image_send_to_editor output
- Using multiple variables to assign categories to an array
- Get options from database using php class
- Limit ‘contributers’ abilities in WordPress
- Custom functions for string data calculations
- Add custom fields from different posts
- Repeat a function with 24hrs gap for n number of days
- MySQL Query Returns Array () In Shortcode
- Problem with inserting multiple images in gallery of each WooCommerce product programmatically
- Convert a column of a table containing an Array as response in HTML
- In PHP how do I make my navigation bar show certain links to admins only?
- Sending simple variable on single page to WP JSON
- Create an array with all the links of the years’ archive (of a custom post type)
- Display just one post from a loop of 5 posts?
- Order users by random not working?
- Woocommerce display orders with products from specific categories to specific admins
- Redux option doensn’t seem when include from functions.php
- in_array not working on dev server but works on localhost
- PHP warning – Use of undefined constant ‘FORCE_SSL_LOGIN’ ‘FORCE_SSL_ADMIN’ on wp-config.php
- admin panel – How to remove “delete” button from category editing page
- wordpress email checker on domain
- problem connecting to the administrator
- How can I show how much water got saved on this order (making use of the number of items bought) on a thank-you-page?
- how to separate an array into different arrays and save them into db?
- How to insert multiple rows and columns in database using array
- How to add a DELETE button to the “Edit User” WordPress admin page?
- Display one random image from Media Library
- How to display MySQL table data which is stored as an array?
- ACF – Get ID of relationship field in flexible content
- Replace an array (with identical values) with another array in the_content
- Show the subcategory name based on current product
- Editing the term_order field
- How to filter specific element of an array in wordpress/php?
- Access to “My Site” is missing from the admin bar
- WP post meta – for loop inside for loop
- get_category_parents to array
- Notice : Array to string conversion on array_intersect user meta
- Combine multiple queries, array_unique returns nothing