transition_post_status hook doesn’t have any POST data when publish with Gutenberg [closed]

But you shouldn’t use $_POST inside that hook. transition_post_status fires when a post is transitioned from one status to another. It can be caused by anything (not only by sending POST request from editor). For example here’s the function that is responsible for publishing future posts: check_and_publish_future_post. It’s called only by cron, without sending any … Read more

What version of React does Gutenberg use?

WordPress 5.1.1 uses React 16.6.3. You can see this in the package.json file in the development version of WordPress on Trac: https://core.trac.wordpress.org/browser/tags/5.1.1/package.json?rev=44861 This has already been updated in trunk to 16.8.4, so the next major version of WordPress will use at least that version.

Gutenberg: Block SelectControl saves attributes but after a reload of Gutenberg it loads its defaults. Why?

The reason why the block editor uses the default value — for the max_level (“Maximum level”) attribute only — instead of the one parsed from the (block comment delimiter in the) saved post content, is because in the parsed/saved attributes, max_level is invalid. Why is it invalid: Because the type of the attribute (value) doesn’t … Read more

How to disable align-wide for specified blocks in Gutenberg

According to the gutenberg handbook you can use the blocks.registerBlockType filter which allows you to play around with the block settings. For most of the wp core blocks modifying the supports.align property works pretty well: wp.hooks.addFilter( ‘blocks.registerBlockType’, ‘my-theme/namespace’, function( settings, name ) { if ( name === ‘core/pullquote’ ) { return lodash.assign( {}, settings, { … Read more

Change the text of the publish button to Save

Put below code into your theme functions.php and try function change_publish_button( $translation, $text ) { if ( $text == ‘Publish…’ ) // Your button text $text=”Save”; return $text; } add_filter( ‘gettext’, ‘change_publish_button’, 10, 2 ); This one is worked for me Hope it will help you!