Editor Notes Block#15763
Conversation
| return ( | ||
| <div className={ className }> | ||
| <p className="wp-block-jetpack-editor-notes__label">{ __( 'Editor Notes', 'jetpack' ) }</p> | ||
| <InnerBlocks __experimentalBlocks={ parsedBlocks } onChange={ onChange } /> |
There was a problem hiding this comment.
Just so everyone knows, __experimentalBlocks will change to value when WordPress/gutenberg#21368 is merged
There was a problem hiding this comment.
(because it matches the api of BlockEditorProvider and basically does the same thing under the hood)
|
Thank you for the great PR description! When this PR is ready for review, please apply the Scheduled Jetpack release: June 2, 2020. |
|
When this gets in, let's clean out our internal version: https://github.com/Automattic/wp-calypso/tree/master/apps/o2-blocks/src/editor-notes |
| return ( | ||
| <div className={ className }> | ||
| <p className="wp-block-jetpack-editor-notes__label">{ __( 'Editor Notes', 'jetpack' ) }</p> | ||
| <InnerBlocks __experimentalBlocks={ parsedBlocks } onChange={ onChange } /> |
There was a problem hiding this comment.
You might want feature availability check before using the experimental feature. :)
There was a problem hiding this comment.
Yup! Actually the idea was to limit this block to a minimum Guten version.
@simison I think the use cases are different (@dmsnell correct me if I'm wrong):
This said, I totally forgot about that other block, so we'll need to find a different name for this! 🙂 |
|
The other one is internal and the slug is different ( |
|
Thanks @Copons for the ping. You are correct: the It would definitely be nice to have a description on the motivation and intention for this block before discussing renaming a block that already exists and has used the name for over a year. A screenshot could help too! Are these meant to be asides in text flow to give some context to what is being written? |
|
@dmsnell You're totally right, I should have written something in the PR description, but haven't had the chance yet, as I'm currently doing this in my 1% time. 😄 You can find more context (and a few screens) here: pb5gDS-xd-p2 Basically: The idea really resonates with me a lot, thinking of my support rotations. When frantically browsing en.support to find a good answer to a ticket or chat, it would be extermely helpful to also find a good predef, or some edge cases to consider, etc. Or, for example, when releasing a new feature, the devs could add notes to its support page, listing some known bugs and workarounds. |
This is actually an idea I've had and yeah I want to update The way you talk about it though sounds more akin to what people do with role and membership plugins. These may not inherently be "editor notes" so much as they are "privileged" or "restricted" content. Do you think it would make sense to be something like that? There are certain blocks that I have observed take their initial form as a specific solution to a specific problem but which (without any code change) are actually a generic solution to many more problems. A few thoughts:
<?php
add_filter( 'jetpack_restricted_block_roles', function( $roles ) {
return array_merge( $roles, [ 'has_active_subscription', 'is_board_member' ] );
} );
add_filter( 'jetpack_restricted_block_rule', function( $allow_block, $block, $role ) {
if ( false == $allow_block ) {
return $allow_block;
}
$user = wp_get_current_user();
switch ( $role ) {
case 'has_active_subscription':
return $user->is_active;
case 'is_board_member':
return in_array( get_board_member_ids(), $user->id, true );
default:
return null; // let the next plugin handle it
}
} ); |
|
@dmsnell These are all excellent observations!
Of course, feel free to commit and experiment here as you wish! |
|
This PR has been marked as stale. This happened because:
No further action is needed. But it's worth checking if this PR has clear testing instructions, is it up to date with master, and it is still valid. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation. |
Fixes #
Changes proposed in this Pull Request:
Is this a new feature or does it add/remove features to an existing part of Jetpack?
Testing instructions:
Proposed changelog entry for your changes: