I need to get the post ID in a Custom PHP Block while working in the editor.
This is not working:
global $post;
echo $post->ID;
Nor is this:
echo get_queried_object_id();
Also this does not work:
if(isset($_GET['action']) && $_GET['action'] === 'edit') {
$post_id = $_GET['post'];
}
This is not working eihter:
get_current_screen()->is_block_editor()
Can this be that hard?