My issue is related to this one: Shortcode not being executed

But I can see my shortcode in action, when I preview the post, but I can't if I save it and view it regularly.

This is my callback for the shortcode:

public function display_dwzlist() {
    echo $this->showTable();
    return ob_get_clean();

showTable() builds a classic html-table and returns a string, e.g.


It seems as if the callback doesn't get called when viewing the saved post, because my logging shows nothing in this case.

Any ideas?

edit: Tried it for testing purposes with another plugin and face the same issue. I use the default wp-theme(with the bird) in my dev-environment. Guess it's somehow related to that.

  • 1
    your shortcode is inside a class, but it's unclear how it's added, where the class is instantiated as an object, or where in the codebase this happens, and there is no logging in your code. Can you update your question to include more code so that it's clearer? Currently there isn't enough information here to diagnose the problem
    – Tom J Nowell
    Commented Sep 8, 2022 at 16:24
  • @TomJNowell As I wrote in the edit, it doesn't seem to be related to my implementation. Because another high-rated plugin has the same issue. Adding is done using boilerplate standard code.
    – UNeverNo
    Commented Sep 8, 2022 at 19:21
  • Boilerplates do have bugs, share it anyway to avoid unnecessary questions and clarifications, there is very little usable information that can be used to gain insights or to eliminate and narrow down possibilities. I understand you want me to just trust that you know but if you knew you wouldn't be here and it's probably something you'll think is really obvious/silly when it's pointed out to you. Have you eliminated other plugins as possible causes by disabling them?
    – Tom J Nowell
    Commented Sep 9, 2022 at 8:29


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.