44

Visibility – custom coded conditions

live
June 19, 2024

In visibility block/panel for more complex conditions, it would be very useful to be able to specify individually coded conditions. For example, I think the Breakdance solution is very good, something similar would be useful is GS as well:
https://breakdance.com/documentation/dynamic-data/conditions/custom-php-conditions/

What do you think?

Added in 4.9.5

6 responses to “Visibility – custom coded conditions”

  1. GreenshiftWP Avatar

    I don’t like version from Breakdance because it can be not secure. But we added extra filters so now it’s possible to do this. Example was added

    https://greenshiftwp.com/visibility-block/

    1. BS Avatar
      BS

      It is not clear to me how to show the content of the block if the condition is true?

      1. GreenshiftWP Avatar

        if condition is true, you don’t need to add anything, it will return block as is, without modification, you must add opposite, when condition is not true – it must show nothing

        1. Balazs Stotz Avatar
          Balazs Stotz

          Thanks, now it’s clear!
          I’m very happy that this is now possible, but I have a suggestion that I think would be much, much better from a UX point of view: couldn’t a free text box with a condition be displayed in the visibility block like any other pre-definied condition? So if the condition entered there is true/false, the block would be displayed/hided. I think it would be much more transparent and manageable if you didn’t have to do it from functions.php or a separate plugin or whatever… With many visibility blocks with unique conditions, it’s quite difficult to keep track of them!

          1. GreenshiftWP Avatar

            do you mean php code area? I think we can’t add it because it will be very high security risk

          2. Balazs Stotz Avatar
            Balazs Stotz

            Yes, I mean a php code area. Why is this a security risk? A lot of plugins have solved this (including your Smarcode plugin… 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

Latest Voters