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

Add advanced BP theme supports checks #301

Closed
wants to merge 3 commits into from

Conversation

imath
Copy link
Member

@imath imath commented May 29, 2024

This PR is extending the WP theme supports API to be able to check Standalone themes opted in for BP Modern features such as the Activity Block Editor.

Usage in theme:

add_theme_support(
	'buddypress',
	array(
		'activity' => array( 'block-editor' ),
		'messages' => array( 'pagination' ),
	)
);

Usage in BuddyPress:

if ( bp_current_theme_supports( array( 'activity' => 'block-editor' ) ) ) {}

Trac ticket: https://buddypress.trac.wordpress.org/ticket/8319


This Pull Request is for code review only. Please keep all other discussion in the BuddyPress Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the WordPress Core Handbook for more details.

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.

Left a few suggestions and questions...

src/bp-core/bp-core-theme-compatibility.php Outdated Show resolved Hide resolved
src/bp-core/bp-core-theme-compatibility.php Outdated Show resolved Hide resolved
src/bp-core/bp-core-theme-compatibility.php Outdated Show resolved Hide resolved
src/bp-core/bp-core-theme-compatibility.php Outdated Show resolved Hide resolved
src/bp-core/bp-core-theme-compatibility.php Outdated Show resolved Hide resolved
src/bp-core/bp-core-theme-compatibility.php Outdated Show resolved Hide resolved
tests/phpunit/testcases/core/themeCompatibility.php Outdated Show resolved Hide resolved
tests/phpunit/testcases/core/themeCompatibility.php Outdated Show resolved Hide resolved
tests/phpunit/testcases/core/themeCompatibility.php Outdated Show resolved Hide resolved
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.

����

@buddypress buddypress deleted a comment from ella225 Jun 8, 2024
@imath imath deleted the add/bp-theme-features branch June 8, 2024 06:12
dcavins pushed a commit to dcavins/buddypress-wp-svn that referenced this pull request Jul 3, 2024
Some of the feature we'll soon introduce like the Block based activity post form will need standalone BP themes to do some adjustments to their code to support them.

Once done, they'll need to opt-in for these features using the WordPress `add_theme_support()` function. The first argument for this function remains `buddypress`. Supporting BP component specific features will need to use a second argument: an associative array keyed by BP Component IDs. For instance, it will be `array( 'activity' => array( 'block-editor' ) )` when a theme support the future Block based activity post form.

In BuddyPress code, we'll then be able for example to use the following kind of check `bp_current_theme_supports( array( 'activity' => 'block-editor' ) )` to be sure the theme fully support the feature.

Props espellcaste

See #8319
Closes buddypress/buddypress#301



git-svn-id: http://buddypress.svn.wordpress.org/trunk@13912 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants