
Lazy Blocks: Select Dynamic Control
v2.9.1janwidmer · 2020年10月23日 上架
lazy-blocks custom control to offer a dynamic select containing wordpress posts, pages or categories
- 正在使用
- 500+
- 评分
- 5.0 / 5
- 累计下载
- 7,715
- 最近更新
- 2025年3月14日
4 条评价需要 WordPress 5.8+已测试到 6.7.12PHP 7.2+
贡献者
This custom control enhances the great Lazy Blocks Plugin and can be used in blocks to offer
the WordPress Author to choose either wordpress posts, pages or categories.
Features
- The custom control dynamically renders a select with options based on the chosen
entityType - Available entity types are
- Post Type
- Taxonomy Type
- Post (Default or Custom post types)
- Page
- Taxonomy (Tags, Categories, Custom Taxonomy)
- The select options can be restricted to use a certain entry as parent
Restrictions
Select Multiple Restrictions
- The option “Select Multiple” is only available for the entity type
Post/Pages/Taxonomy
Max Item Restriction
The custom control is using the getEntityRecords method.
- This method can load a maximum of 100 entities and render them as dropdown options
- When choosing the entity type
Page, depending on the number of pages you have, the first time, the call might take
a while, as the whole page object get’s loaded - To use a custom taxonomy type, make sure to activate the REST option in the
register_taxonomyfunction by adding'show_in_rest' => true, - Parent Entity Restriction does only work for Pages / Categories / Custom Taxonomies, as other Entity Types (e.g. Posts / Tags) cannot be nested
- For the
entityTypepost-type, an ignore list excludes all wordpress related post types:pages,media,blocks,menu-items,navigation,templates,template-parts,lazyblocks,lazyblocks_templates
Usage
You can use the custom control exactly how you use normal controls for lazy blocks