Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce a BP Search Block as a BuddyPress Add-on #62

Merged
merged 11 commits into from Dec 30, 2021
Merged

Conversation

imath
Copy link
Member

@imath imath commented Dec 29, 2021

We've decided during the 10.0.0 development cycle that new BuddyPress blocks would be packaged as BuddyPress Add-ons and published into the WordPress Blocks/Plugins directory.

Here's the first block as BuddyPress add-on: BP Search Block. It's a block that uses a very old feature that was available when the BP Default theme was our main front-end playground. A search form with search options to look for members, groups, blogs or posts. Here's how it looks into a regular WordPress page:

front-end

As you can see, I've added the possibility to search for Activities. BuddyPress doesn't support this for now, but I'll open a ticket to quickly add this support into 10.0.0. I believe being able to search in activities from this block is a must have!

Here's how it looks into the Blocks editor:

block-editor

From the Sidebar settings, you can select which component can be listed into the "Search for" radio group. Using this radio group, you can switch the default selected radio item.

This block requires WordPress 5.8 because it uses the block.json Metadata. It also uses version 2 of the Block API.

I've also adapted the BP Blocks plugin, so that it's easier to build these "standalone" blocks in the future.

My idea is to request a WordPress.org repository for this block so that it can be listed into the BuddyPress Add-ons tab we've added to the Plugins/Add new Administration screen.

@imath imath added the enhancement New feature or request label Dec 29, 2021
@imath imath self-assigned this Dec 29, 2021
If v2 of the Block API was introduced in WP 5.6, using a `block.json` Metadata file was introduced in 5.8.
This makes sure people don't get confuse with the WP Block Search.
Copy link
Member

@renatonascalves renatonascalves left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

add-ons/bp-search-block/block.json Show resolved Hide resolved
add-ons/bp-search-block/block.json Show resolved Hide resolved
add-ons/bp-search-block/bp-search-block.php Outdated Show resolved Hide resolved
src/add-ons/bp-search-block/block.json Show resolved Hide resolved
src/add-ons/bp-search-block/block.json Show resolved Hide resolved
@imath
Copy link
Member Author

imath commented Dec 30, 2021

Thanks a lot for your feedbacks @renatonascalves 😍 . I'll improve the "posts in post" thing 👍

Take in account Renato's feedback an avoid "posts in post".
@imath imath merged commit fe01ca8 into master Dec 30, 2021
@imath imath deleted the introduce/addons branch December 30, 2021 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants