Title: Create two additional fields
Last modified: October 7, 2019

---

# Create two additional fields

 *  Resolved [sergejos](https://wordpress.org/support/users/sergejos/)
 * (@sergejos)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/create-two-additional-fields/)
 * Hello,
    I added a new additional field within a new tab with this documentation
   [https://wpstorelocator.co/document/add-custom-meta-data-to-store-locations/](https://wpstorelocator.co/document/add-custom-meta-data-to-store-locations/).
   Now I’m trying to make another additional field within this new tab.
 * My problem is, that I don’t know how to edit the array in the [https://wpstorelocator.co/document/wpsl_frontend_meta_fields/](https://wpstorelocator.co/document/wpsl_frontend_meta_fields/)
   to make a second field.
 * Can you say me, how the array should be like, to specify a second additional 
   field? (both new additional fields should be type text)
 * Thank you in advance
    -  This topic was modified 6 years, 7 months ago by [sergejos](https://wordpress.org/support/users/sergejos/).

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Tijmen Smit](https://wordpress.org/support/users/tijmensmit/)
 * (@tijmensmit)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/create-two-additional-fields/#post-12004946)
 * If you create a new tab, and want to use [multiple fields](https://wpstorelocator.co/document/add-custom-meta-data-to-store-locations/#create-metabox-field)
   in that tab, then it should use this structure.
 *     ```
       add_filter( 'wpsl_meta_box_fields', 'custom_meta_box_fields' );
   
       function custom_meta_box_fields( $meta_fields ) {
   
           $meta_fields[__( 'Custom tab', 'wpsl' )] = array(
               'custom-1' => array(
                   'label' => __( 'Custom 1', 'wpsl' )
               ),
               'custom-2' => array(
                   'label' => __( 'Custom 2', 'wpsl' )
               ),
           );
   
           return $meta_fields;
       }
       ```
   
    -  This reply was modified 6 years, 7 months ago by [Tijmen Smit](https://wordpress.org/support/users/tijmensmit/).
 *  Thread Starter [sergejos](https://wordpress.org/support/users/sergejos/)
 * (@sergejos)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/create-two-additional-fields/#post-12005185)
 * Yes, I used this.
 * But I have to specify the type of the field or not? And I don’t know, how to 
   specify both fields within the custom_frontend_meta_fields function as a text
   field.
 *     ```
       add_filter( 'wpsl_frontend_meta_fields', 'custom_frontend_meta_fields' );
   
       function custom_frontend_meta_fields( $store_fields ) {
   
           $store_fields['wpsl_my_textinput'] = array( 
               'name' => 'my_textinput',
               'type' => 'text'
           );
   
           return $store_fields;
       }
       ```
   
 * Here I can only specify one field and I don’t know, how to edit the array $store_fields
   so that both fields (Custom 1 and Custom 2) are text fields.
 *  Plugin Author [Tijmen Smit](https://wordpress.org/support/users/tijmensmit/)
 * (@tijmensmit)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/create-two-additional-fields/#post-12008161)
 * If no type is provided, then it will default to text.
 * You can simply repeat it like this.
 *     ```
         $store_fields['wpsl_my_textinput'] = array( 
               'name' => 'my_textinput'
           );
   
         $store_fields['wpsl_other_textinput'] = array( 
               'name' => 'other_textinput'
           );
       ```
   
 *  Thread Starter [sergejos](https://wordpress.org/support/users/sergejos/)
 * (@sergejos)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/create-two-additional-fields/#post-12008685)
 * Thank you, it worked!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Create two additional fields’ is closed to new replies.

 * ![](https://ps.w.org/wp-store-locator/assets/icon-256x256.jpg?rev=1007784)
 * [WP Store Locator](https://wordpress.org/plugins/wp-store-locator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-store-locator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-store-locator/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-store-locator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-store-locator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-store-locator/reviews/)

## Tags

 * [additional field](https://wordpress.org/support/topic-tag/additional-field/)

 * 4 replies
 * 2 participants
 * Last reply from: [sergejos](https://wordpress.org/support/users/sergejos/)
 * Last activity: [6 years, 7 months ago](https://wordpress.org/support/topic/create-two-additional-fields/#post-12008685)
 * Status: resolved