-
Notifications
You must be signed in to change notification settings - Fork 13
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
Allow larger attributes by using new <ServerSideRender> prop #39
Conversation
Even if there is a lot of text, the block preview should still render.
* @param string $method_name The name of the method to get the callback for. | ||
* @return callable An enclosure that calls the function. | ||
*/ | ||
protected function get_callback( $method_name ) { |
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.
Not related to this PR, but it's not necessary.
I wanted to keep methods protected
, and use ->get_callback
to expose them in add_action()
and add_filter()
.
But this is verbose and unnecessary 🤣
🎉 |
$initial_routes didn't reallly do anything before.
@@ -38,6 +38,7 @@ const Edit = ( { blockProps, block } ) => { | |||
block={ `genesis-custom-blocks/${ block.name }` } | |||
attributes={ attributes } | |||
className="genesis-custom-blocks-editor__ssr" | |||
httpMethod="POST" |
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.
A new prop
for this component.
Hi @nickcernis and @mindctrl, This fixes an issue where the REST API endpoint for the BHH-569 has more details. Thanks! |
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.
Working great for me with a million "a"s, @kienstra. [About 1MB of text.]
Works under 5.4.2 too. Great job covering that.
* The <ServerSideRender> uses the httpMethod of 'POST' to handle a larger attributes object. | ||
* That is already added in WP 5.6+, so no need to add it there. | ||
* | ||
* @todo: Delete when this plugin's 'Requires at least' is bumped to 5.6. |
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.
Good idea to add this reminder. Will be nice when we can bump the minimum version to 5.6.
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.
Thanks! Yeah, that'll be good!
Thanks so much for reviewing this. |
Changes
Even if there is a lot of text, the block preview will still render:
Fixes issues reported in BL: #477, #436, #511
Testing instructions