I have told my own kid to potty in his pants before when at the beach.
I remember when my now 10 year old son was 6 years old and he was at the beach with me and his younger brother who was 3 years old.
The 3 year old was in his diaper and would of course use his diaper for pee and poop as it is needed for him as he was not potty trained.
My 6 year old son had to go pee and I told him that he could just pee in his pants if he wanted too and so he did.
After he wet his pants I then told him that he should wear a diaper so I put one of his 3 year old brothers Pampers Cruisers diapers on him.
My 6 year old son then wore the Pampers Cruisers diapers for the rest of the weekend when on the beach while we were camping.
He then decided it was better to wear a diaper and use the diapers instead and he wore no pants over the diaper on the beach.
I let him wear the Pampers diapers for the rest of the year and he still wanted to wear them until he was 8 years old all the time.
Now he still seems to love diapers and that's okay but he wears them occasionally only on the weekends or in the summer like now.
Now my 10 year old son is wearing diapers this summer and when at home he prefers to wear just the diaper and shirt.
I buy my 10 year old son who is skinny enough to wear them the Gentle Steps size 7 diapers.
He wears them for bed wetting anyway but during the summer he wants to wear them all the time and use them for both pee and poop and I'm okay with that.