Gutenberg: Use Blocks from staging dir if proxied#10713
Conversation
|
D21283-code. (newly created revision) |
|
Thank you for the great PR description! When this PR is ready for review, please apply the Scheduled Jetpack release: November 26, 2018. Generated by 🚫 dangerJS |
9a2497f to
ef1d4e5
Compare
|
Hmm, the Fusion-produced patch is wonky. Looks like the file has gone out of sync 🙁 |
|
Looks like it's because of #10537. |
class.jetpack-gutenberg.php
Outdated
| * @return string The Gutenberg extensions directory | ||
| */ | ||
| public static function get_blocks_directory() { | ||
| if ( function_exists( 'wpcom_is_proxied_request' ) && wpcom_is_proxied_request() ) { |
There was a problem hiding this comment.
instead of doing this can we just add a filer for this?
This way we can just filter it on .com and not have to reply on function exiting check
class.jetpack-gutenberg.php
Outdated
| if ( apply_filters( 'jetpack_blocks_load_staging', false ) ) { | ||
| return '_inc/blocks-staging/'; | ||
| } | ||
| return '_inc/blocks/'; |
There was a problem hiding this comment.
I was thinking more like
public static function get_blocks_directory() {
/**
filter doc block
*/
return apply_filters( 'jetpack_blocks_directory', '_inc/blocks-staging/' );
}
enejb
left a comment
There was a problem hiding this comment.
I tested this and it works as expected. Nicely done
Mostly relevant for the WP.com side. See pMz3w-9fO-p2 for context.
Changes proposed in this Pull Request:
Testing instructions:
Verify that Jetpack's Gutenberg blocks still work as before, with no errors throw.
Proposed changelog entry for your changes: