Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Shortlinks: Register as REST API post field and Gutenberg plugin (#10981
) In the WP.com old editor, we used to have the shortlinks handy in the sidebar. We don't have them in Gutenberg, and they can sometimes be a very handy feature. This PR registers the post shortlink as a REST API field, and as a Gutenberg plugin, which are necessary to be able to build the UI for shortlinks in Gutenberg. #### Changes proposed in this Pull Request: * Add shortlinks to the REST API post response. * Register shortlinks as a Gutenberg plugin, so they're available in our block availability endpoint. #### Testing instructions: * Start a JN site with this branch. * Connect the site, and activate all recommended features. * Write a post and save it. * Type `wp.data.select( 'core/editor' ).getCurrentPost().jetpack_shortlink` in your browser console. * Verify it returns a correct shortlink that leads to the post you just created. * Type `window.Jetpack_Editor_Initial_State.available_blocks.shortlinks` in your browser console. * Verify it returns `{available: true}`. * Want to test the actual Gutenberg extension that uses this? Go to Automattic/wp-calypso#29475 and follow the test instructions there #### Proposed changelog entry for your changes: * Shortlinks: Register as REST API post field and Gutenberg plugin #### Notes I'm marking this as low priority, as it isn't super important to have. In the same time, I think it's handy to have it, and it's straightforward enough so we could have it ready for the next Jetpack version.
- Loading branch information