-
Notifications
You must be signed in to change notification settings - Fork 826
Newspack blocks: Load feature on agency sites #44906
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
Conversation
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Mu Wpcom plugin:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Wpcomsh plugin:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
Code Coverage SummaryCoverage changed in 1 file.
Coverage check overridden by
I don't care about code coverage for this PR
|
@@ -290,6 +290,23 @@ public static function load_features() { | |||
require_once __DIR__ . '/features/wpcom-widgets/wpcom-widgets.php'; | |||
require_once __DIR__ . '/features/wpcom-wpadmin-page-view/wpcom-wpadmin-page-view.php'; | |||
|
|||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think all the inline logic here is out of place and does not belong here. The function comment explicitly says:
/**
* Load features that don't need any special loading considerations.
*/
public static function load_features() {
Maybe create another function like load_newspack_blocks()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created by 8e01271.
@@ -409,10 +425,6 @@ public static function load_etk_features() { | |||
|
|||
/** | |||
* Load features for the editor and the frontend pages. | |||
* | |||
* This also avoid redeclaring the `Newspack_Blocks` class as follows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we delete
if ( ! class_exists( '\Newspack_Blocks', false ) ) {
require_once __DIR__ . '/features/newspack-blocks/index.php';
}
given that we already load it in load_features()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and it works perfectly!
Fixes p1755839647067029/1755669212.510819-slack-C091P0A65U5
Proposed changes:
Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
Content Carousel
andBlog Posts