How to hide if plugin currently empty

Just recently I installed FuneralPress (obituary) but fortunately I do not have anything to publish right now. Can we use some smart code to hide a plugin if empty? This could be useful in other plugins also.

My current solution is disable this plugin, hardly the best solution.

  • Vinod Dalvi
    • WP Unicorn

    Hi @Wouter Jan Kok,

    Greetings and thanks for posting on the forums.

    How to hide if plugin currently empty

    Do you mean hiding the plugin if the content of it is empty?

    If yes then you can just deactivate the plugin if it's not in use.

    Could you please tell me why you don't want to disable the plugin but wants to hide it?

    Kind Regards,
    Vinod Dalvi

  • Wouter Jan Kok
    • Site Builder, Child of Zeus

    Hello @Vinod,

    Do you mean hiding the plugin if the content of it is empty?

    Exactly!

    I think. It is good practice to delete all non used plugins and themes. By keeping them active they are being updated, if needed.
    Besides that it does feel like logic flaw to show empty fields.

    Think of being a tourist in different country. You look and find all kinds of information like museum, train station on your map. You go and visit and find them empty, not used. Why show them?

  • Vinod Dalvi
    • WP Unicorn

    Hi @Wouter Jan Kok,

    Thank you for your reply.

    How to hide if plugin currently empty

    I think. It is good practice to delete all non used plugins and themes.

    Could you please tell me clearly you want to hide the plugins from users while it's working in background or you want to delete / uninstall / deactivate it?

    By keeping them active they are being updated, if needed.
    Besides that it does feel like logic flaw to show empty fields.

    Then why don't you deactivate it manually until it is used there isn't any content added to publish?

    Regards,
    Vinod Dalvi

  • Wouter Jan Kok
    • Site Builder, Child of Zeus

    @Vinod Dalvi

    The thing is. I did manually disable the plugin, but after enabling it - as a test. It did recreate the database and after doing so I do have to recheck all the settings, just to be certain all is well.

    For me the optimum situation would be.
    Install FuneralPress, configure the plugin and then because there is no obituary effective the front would not be visible. However because the plugin is active (in the backend) all updates will be shown when available. When we have a obituary effective the plugin will be visible in the frontend also.
    Please take a look into my test website (Dutch) at http://www.ferengi.nl

    Oh dear...my wife (being computer illiterate) just points out..."Why don't you just disable that menu item?".

    Well, it does solve this problem, I love here :wink:

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.