Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion backport-changelog/7.1/11712.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
https://github.com/WordPress/wordpress-develop/pull/11712

* https://github.com/WordPress/gutenberg/pull/77911
* https://github.com/WordPress/gutenberg/pull/77911
* https://github.com/WordPress/gutenberg/pull/78613
10 changes: 4 additions & 6 deletions lib/compat/wordpress-7.1/classic-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@

if ( ! function_exists( 'wp_declare_classic_block_necessary' ) ) {
/**
* Inject a global JS flag that declares the editor will need the classic block.
* Declares a flag that the Classic block is necessary for the current post.
*
* @global WP_Post|null $post The post being edited, or null if not in the post editor.
* @since 7.1.0
*/
function wp_declare_classic_block_necessary() {
global $post;

function wp_declare_classic_block_necessary(): void {
/**
* Filters whether the Classic block should be available in the inserter.
*
Expand All @@ -23,7 +21,7 @@ function wp_declare_classic_block_necessary() {
* @param bool $supports_inserter Whether the Classic block is available in the inserter.
* @param WP_Post|null $post The post being edited, or null if not in the post editor.
*/
if ( ! (bool) apply_filters( 'wp_classic_block_supports_inserter', false, $post ) ) {
if ( ! (bool) apply_filters( 'wp_classic_block_supports_inserter', false, get_post() ) ) {
return;
}

Expand Down
Loading