You appear to be referring to the code snippets from the top of this post…
These snippets of code outline a modification made to the full sketch that follows, because of a change in the way that the ESP8266 core works from version 3.0.x onwards.
Below these snippets of code, after the words “[END OF 14th January 2022 EDIT]]”, there is a full working Edgent .ino sketch.
If you aren’t able to take this working sketch and modify it to suit your purposes then I can’t really help you any further.
Pete.