0 ) { return; } $id = self::find(); if ( $id < 1 ) { $id = wp_insert_post( [ 'post_type' => 'page', 'post_status' => 'publish', 'post_title' => __( 'Your reservation', 'flexatech-table-reservations' ), 'post_content' => '', ] ); // 0 when the insert fails. } update_option( self::OPTION, $id ); } /** A published page with the block or its shortcode on it, or 0. */ private static function find(): int { return BlockRegistry::page_with( self::BLOCK ); } }