Skip to content

Commit

Permalink
Added SortablePostSearchControl component.
Browse files Browse the repository at this point in the history
  • Loading branch information
tnke committed Sep 16, 2024
1 parent 256e704 commit d0a8133
Show file tree
Hide file tree
Showing 11 changed files with 253 additions and 6,972 deletions.
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,31 @@ Select and sort multiple posts, with search filtering. Takes an array of post ob
/>
```

### SortablePostSearchControl

Select and sort multiple posts, by searching from a large pool of posts. Takes an array of post ids as value and returns the same on change.

![SortablePostsControl example](assets/SortablePostsControl-screenshot-01.png)

```javascript
<SortablePostSearchControl
type="page"
label="Choose pages"
placeholder="Search here"
value={mySelectedPageIds}
onChange={(value) =>
setAttributes({
mySelectedPageIds: value,
})
}
numOfInitialResults={20}
filterResults={(results) => {
// You can modify the search results before returning them.
return results;
}}
/>
```

### TaxonomyControl

Similar to the default WordPress category selector, shows a filterable list of checkboxes.
Expand Down Expand Up @@ -161,6 +186,11 @@ const loremIpsumStories = usePostSearch({

## Changelog

### 6.1.0

- Refactored the way textdomain is used and removed config.json.
- Introduced `SortablePostSearchControl`.

### 6.0.0

- Updated npm dependencies
Expand Down
239 changes: 1 addition & 238 deletions build/index-rtl.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/index.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '6e070825a2fb1fe9feb8');
<?php return array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '4e6cf2fb03a0956fac5e');
Loading

0 comments on commit d0a8133

Please sign in to comment.