If your plugin content can appear at the beginning or end of content, you could use “the_content” filter, but you should give users a way to manage on which posts or pages you add content, unless it’s the sort of thing that should be on every post, like an up/down vote element or something.
Shortcodes have been the common solution for many plugins which allows users to add your plugin’s output anywhere they like. With the introduction of the new block editor (Gutenberg), we are expected to forego shortcodes for custom block elements. With so many people using the classic editor still, plugin devs should be providing both. In any case, I expect the block editor to support shortcodes for a good long while.
For users with a child theme who have customized their theme templates, it might be useful to provide a PHP template tag (just a normal function call which generates output) for their use.
]]>I think I might go with a shortcode for the main listing of the posts (it will essentially replace the CPT archive page) and will use the default links for the single CPT pages.
]]>I’ll look into doing the same for archive pages as I want to have some customization/flexibility regarding how they are displayed etc.
Thanks for your input.
]]>