[wp-meta] [Making WordPress.org] #6945: Create Props Block for Make Blogs and Deverloper Blog
Making WordPress.org
noreply at wordpress.org
Tue May 16 07:50:26 UTC 2023
#6945: Create Props Block for Make Blogs and Deverloper Blog
-----------------------------------------------------+---------------------
Reporter: bph | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone:
Component: Make (Get Involved) / P2 | Resolution:
Keywords: dev-feedback good-first-bug needs-patch |
-----------------------------------------------------+---------------------
Comment (by gaambo):
Hi,
I'm interested in giving this a go, but have some questions:
1. How are props linked at the moment? Are links added to the usernames
manually or somehow automatically - and if automatically on rendering or
on saving?
2. "Extends the Paragraph block" - So at the moment is this just a normal
paragraph block? That means that usernames and their roles are just
written as text and usernames would have to be parsed out of the text
(probably by a regex)
3. If we extend the paragraph block, we would probably just add a toggle
to the paragraph block to enable "props syncing" or something like that.
4. I'd actually think a custom block "Props" which uses the RichText
component and opts into some block supports (colors, typography,...) would
be clearer and not polute the paragraph block (which is used a lot in the
posts). But you as the editors using that probably have a better
understanding of that.
5. I'm thinking about where to call the add_activity function. A server-
side callback on save_post would be one option. This would be another case
where a custom block is easier, because we'd just have to check if this
custom block exists in the post. If a paragraph block is used we'd have to
loop through all the paragraph blocks and check if it has the "props sync"
attribute enabled. Another option would be to call a custom REST API
endpoint when the block editor publishes the post. But that means it only
works on edits through the block editor - I don't know if there are any
edits that could happen via REST API or the WordPress mobile app? If yes,
we'd need the save_post hook as well.
6. We'd somehow need to save the props that we already sent as activity to
.org, so when someone updates the post - and maybe adds new props or
deletes some, we can compare them and only sync those. Probably the
easiest way would be to store the props that were already handled in a
postmeta field.
--
Ticket URL: <https://meta.trac.wordpress.org/ticket/6945#comment:4>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org
More information about the wp-meta
mailing list