-
Notifications
You must be signed in to change notification settings - Fork 800
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
Subscriptions: add block binding returning subscriber count #36245
base: trunk
Are you sure you want to change the base?
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 🤖 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. Once your PR is ready for review, check one last time that all required checks appearing at the bottom of this PR are passing or skipped. Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
I think that's expected, the fallback content is what gets displayed in the editor because depending on the source, the rendered value can only be derived from the context. There are exceptions, like your example, since count of subscribers is a global thing but I imagine that's something that could be iterated on upstream. |
Yeah, I figured the text doesn't show in editor either because of some combo of WP This kind of binding would be indeed more useful in site editor templates or pages, rather than in blog posts, anyway. |
If I'm not wrong, you need to register the handler in the client, as core does when registering the The action hasn't been exposed and it's usable internally for now 😬 |
I kind of disagree :-D. I imagine many cases where API can be used in the context of the post editor. |
@retrofox I totally agree with you on those points but I meant for subscriber count specifically, which is the kind of info publishers would be presented outside the post content most of the time. :-) Example: |
got it now! |
Thanks! Makes sense. I wonder if it would make sense for editor side to just handle that registration automatically, since all the information sort of exists in the backend binding already, and there's the concept of "backend rendered blocks" in the client side already. 🤔 |
Yeah, do you mean dynamic blocks? For instance, how does the |
This PR has been marked as stale. This happened because:
If this PR is still useful, please do a [trunk merge or rebase](https://github.com/Automattic/jetpack/blob/trunk/docs/git-workflow.md#keeping-your-branch-up-to-date) and otherwise make sure it's up to date and has clear testing instructions. You may also want to ping possible reviewers in case they've forgotten about it. Please close this PR if you think it's not valid anymore — if you do, please add a brief explanation. If the PR is not updated (or at least commented on) in another month, it will be automatically closed. |
2e1c0da
to
331421f
Compare
331421f
to
4f4b6b2
Compare
4f4b6b2
to
34b9376
Compare
This PR has been marked as stale. This happened because:
If this PR is still useful, please do a [trunk merge or rebase](https://github.com/Automattic/jetpack/blob/trunk/docs/git-workflow.md#keeping-your-branch-up-to-date) and otherwise make sure it's up to date and has clear testing instructions. You may also want to ping possible reviewers in case they've forgotten about it. Please close this PR if you think it's not valid anymore — if you do, please add a brief explanation. If the PR is not updated (or at least commented on) in another month, it will be automatically closed. |
Adds new block binding API for subscriptions, available in WP 6.5. (Dev note)
With block:
You would get in the frontend of the post:
Same text should appear in the editor, but at least for me I just see binding paragraph but no text:
Proposed changes:
Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions: