Codeinwp / otter-blocks

Create beautiful and attracting posts, pages, and landing pages with Gutenberg Blocks and Template Library by Otter.
https://wordpress.org/plugins/otter-blocks/
GNU General Public License v3.0
135 stars 35 forks source link

Use only searchable post type for Live Search #2196

Closed Soare-Robert-Daniel closed 5 months ago

Soare-Robert-Daniel commented 5 months ago

Closes https://github.com/Codeinwp/otter-internals/issues/166

Summary

Filter out any non-searchable post type from the Live Search Block.

Screenshot 2024-04-29 at 18 43 43

[Docs] For users who want to user their own Custom Post Type

Users who want their post type to appear in the search must register their post type with public set to true and exclude_from_search set to false.

register_post_type( 'my_post_type', array(
            'public' => true,
            'exclude_from_search' => false,
            'label'  => 'My Post Type',
) );

Test instructions

  1. With Otter Pro, insert a Search Block and activate the Live Search
  2. In the post types, you should see only the searchable post types ( they are registered as public and not excluded from search query )

Checklist before the final review

pirate-bot commented 5 months ago

Bundle Size Diff

Package Old Size New Size Diff
Animations 239.1 KB 239.1 KB 0 B (0.00%)
Blocks 1.5 MB 1.5 MB 0 B (0.00%)
CSS 93.17 KB 93.17 KB 0 B (0.00%)
Dashboard 201.53 KB 201.53 KB 0 B (0.00%)
Onboarding 154.18 KB 154.18 KB 0 B (0.00%)
Export Import 90.95 KB 90.95 KB 0 B (0.00%)
Pro 355.91 KB 355.91 KB 0 B (0.00%)
pirate-bot commented 5 months ago

Plugin build for 2e8f9f74d01d2fff698477300268eba611bb2e01 is ready :bellhop_bell:!

pirate-bot commented 5 months ago

E2E Tests

Playwright Test Status:

Performance Results serverResponse: 221, firstPaint: 546.15, domContentLoaded: 1558.25, loaded: 1559.15, firstContentfulPaint: 3645.75, firstBlock: 5485.3, type: 12.24, minType: 10.52, maxType: 14.92, typeContainer: 7.94, minTypeContainer: 6.6, maxTypeContainer: 9.83, focus: 43.28, minFocus: 34.75, maxFocus: 57.04, inserterOpen: 27.4, minInserterOpen: 24.81, maxInserterOpen: 30.57, inserterSearch: 6.46, minInserterSearch: 6.07, maxInserterSearch: 6.93, inserterHover: 3.36, minInserterHover: 2.73, maxInserterHover: 4.26, listViewOpen: 157.33, minListViewOpen: 140.9, maxListViewOpen: 170.06
pirate-bot commented 5 months ago

:tada: This PR is included in version 2.6.12 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: