Hot answers tagged

2

No, blocks are built with more than HTML - they need JS and PHP. However, you could add an HTML block wherever you need it, then click the More Options dots in the block's toolbar, click Add to Reusable Blocks, name your block, and save it. That block will then be available to use wherever you want it, and if you edit it, that will apply the changes ...


1

Out of the box there is no mechanism for a user to login via the REST API to begin a session without pre-configured access. WordPress Core provides 2 authentication methods for the REST API: cookies + nonces application passwords Likewise there is no mechanism for registering for an account via the REST API, user creation requires authenticated requests ...


1

A shortcode should only ever return content, never echo it. The bits between the ?> and <?php tags -- the <script> tags and the rest -- are effectively being echoed to the browser, which means that the JSON content that Gutenberg expects is no longer valid. From the add_shortcode() docs: Note that the function called by the shortcode should ...


1

I think the only thing missing here is an update_callback in the call to register_rest_field. register_rest_field( 'note', 'noteLink', array( 'get_callback' => function(){ return get_field('page_link'); }, 'update_callback' => function( $value, $post ){ update_field('field_619dacfd37924', $value, $post->ID ); }...


1

At this time, typography.fontFamilies is only available in the Gutenberg plugin. The plugin must be installed for this setting to take effect. See the comparison toggle at https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-json/#settings


1

TL;DR - ACF now has support for the WP REST API Hey all, Iain the Product Manager for Advanced Custom Fields here 👋 As part of the ACF 5.11 release we added native support for ACF fields in the WordPress REST API. Read more about that here.


Only top voted, non community-wiki answers of a minimum length are eligible