0

I am building a plugin that allows users to display information to the front-end of a website.

When users want to display this information they have to add in a shortcode to the page they would like to display the data on. However if a user wants to display this info on every single page then they will have to add this shortcode to each page. Is there a way to automate this process? Can this also be achieved by the use of a single function?

2
  • Does it have to be in the content as a shortcode? If you lessen that constraint additional solutions become possible, such as calling the function that implements the shortcode and appending the results to the page content at runtime. Also, what about users who rely on the block editor?
    – Tom J Nowell
    Jul 14 '20 at 12:54
  • Implementing it with a shortcode was the first thing that came to mind, I am still quite new in the proces of developing wordpress plugins. Therefore I'm always open for more solutions as long as they are reliable and not harmful to other front-end functionality. Also for users using the block editor, I don't think this should be a problem.
    – Gianni
    Jul 14 '20 at 14:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.