humanmade / humanmade/Custom-Meta-Boxes

Using Mulitple on post select shows multiple selections on edit

Open
#428 11 comments 0 reactions 0 assignees View on GitHub
Bug
Dominant language
PHP
Stars
516
Forks
118
PR merge metrics
No merged PRs in 30d

Description

I have a post select field on one of my pages that uses the `multiple` option.

```php
array(
'id' => 'home_featured_pages',
'name' => __('Featured Pages', 'edit2017'),
'type' => 'post_select',
'use_ajax' => true,
'multiple' => true,
'query' => array(
'post_type' => 'page'
)
)
```

When I edit the page to begin with it works as it should letting me select as many pages as I want.

After saving the page and coming back to edit it I get each page in its own select2 box.

![image](https://cloud.githubusercontent.com/assets/19609/24363130/c4b525b8-1306-11e7-949d-4266de3a72db.png)

All the boxes have the same id/name and only the first one gets saved.

I'm using the latest `dev-master` code.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.