• Resolved capariciof

    (@capariciof)


    Hello, you know how I can open the popup automatically using a command in php or html?

    I have a condition function (if… else) in php and I require the popup to open with one certain condition.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Daniel Iser

    (@danieliser)

    @capariciof – Depends on your server setup, heavily cached servers for instance won’t work for all conditions via PHP, some require JS based conditions.

    That said check out: http://docs.wppopupmaker.com/article/132-add-a-custom-popup-condition

    That adds a new condition to the editor itself.

    You can also use JavaScript manually to trigger it, (rendered by PHP).

    jQuery(document).ready(function () {
        PUM.open(123); // 123 is the popup ID #
    });
    Thread Starter capariciof

    (@capariciof)

    I can use user meta data with custom popup codition in a page?

    Plugin Author Daniel Iser

    (@danieliser)

    @capariciof – Absolutely. Anything you can do in PHP can be turned into a condition.

    At the minimum you need to write a function that returns true or false. So if you wanted to check if a user meta value was set as a condition it could be as simple as

    function custom_condition_callback( $settings ) {
        return get_user_meta( get_current_user_id, 'meta_key' ) != false;
    }

    That said conditions can be as complex or simple as you need them to be. The link I gave above had several sample conditions of varying complexity.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Open Popup with conditional PHP code’ is closed to new replies.