Thank you for your feedback.
I have one more question.
Should I change everywhere in the plugin's code?
- this
global $post
toglobal $wp_query
- this
post->ID
to$wp_query->post->ID
- this
post->post_parent
to$wp_query->post->post_parent
Or I should change it only in one place (for [subpages] shortcode only)?