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

Blog Stats Block: Add Transform from Legacy Widget #35408

Merged
merged 2 commits into from
Feb 4, 2024

Conversation

Aurorum
Copy link
Contributor

@Aurorum Aurorum commented Feb 2, 2024

Follow-up to #34557

Proposed changes:

  • Allows the existing Blog Stats widget to be converted into the new block, which also has superior customisation abilities

Jetpack product discussion

N/A.

Does this pull request change what data or activity we track or use?

No.

Testing instructions:

You'll want to remove this first so that the Legacy Widget still appears:

add_filter( 'widget_types_to_hide_from_legacy_widget_block', array( $this, 'hide_widget_in_block_editor' ) );
}
/**
* Remove the "Blog Stats" widget from the Legacy Widget block
*
* @param array $widget_types List of widgets that are currently removed from the Legacy Widget block.
* @return array $widget_types New list of widgets that will be removed.
*/
public function hide_widget_in_block_editor( $widget_types ) {
$widget_types[] = 'blog-stats';
return $widget_types;
}

You can then add it to your site, and confirm that you can transform the block (press the calendar icon in the top left). The label should stay the same, and it should create a heading if you already have a widget title.

Screenshot 2024-02-02 at 09 07 35 Screenshot 2024-02-02 at 09 07 39 Screenshot 2024-02-02 at 09 07 46

cc @kangzj - sorry, should have added it to start with but #34717 reminded me!

@github-actions github-actions bot added [Block] Blog Stats [Feature] Extra Sidebar Widgets [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ labels Feb 2, 2024
Copy link
Contributor

github-actions bot commented Feb 2, 2024

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

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 🤖


The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.



Jetpack plugin:

The Jetpack plugin has different release cadences depending on the platform:

  • WordPress.com Simple releases happen daily.
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly. The next release is scheduled for February 6, 2024 (scheduled code freeze on February 5, 2024).

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@github-actions github-actions bot added the OSS Citizen This Pull Request was opened by an Open Source contributor. label Feb 2, 2024
@anomiex anomiex requested a review from kangzj February 2, 2024 15:12
@anomiex anomiex added the [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. label Feb 2, 2024
Copy link
Contributor

@kangzj kangzj left a comment

Choose a reason for hiding this comment

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

It tests well for me 👍

Note: I had to enable 'Extra sidebar widgets' from /wp-admin/admin.php?page=jetpack_modules&module_tag=Appearance to be able to add the legacy widget.

@kangzj kangzj merged commit 6b2834c into Automattic:trunk Feb 4, 2024
53 checks passed
@github-actions github-actions bot added this to the jetpack/13.1 milestone Feb 4, 2024
@github-actions github-actions bot removed the [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. label Feb 4, 2024
spsiddarthan pushed a commit that referenced this pull request Feb 15, 2024
* Changelog

* Add transform from legacy widget
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Blog Stats [Feature] Extra Sidebar Widgets OSS Citizen This Pull Request was opened by an Open Source contributor. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants