Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Nam_n

    (@nameez)

    Anyone? 🙂

    Hi Nam_n,

    As far as I know, WordPress runs with sessions “on” for logged-in users, but does not start sessions for all visitors. If you are having them log in, then a plugin such as the “Groups” plugin would be a much more secure option.

    I am sure there is a way to start sessions from within a plug in, but that is a technical answer far beyond how to use this plugin…. If the pluin runs before any content is put out, then it should work fine.

    If there is some other function that starts a session, you should be able to examine the session variables in the PHP part of this plugin, since session variables are global.

    Plugin Author Bainternet

    (@bainternet)

    You can try somehitng like this, set the shortcode type to advanced, in the php setion of the shortcode paste this:

    if (session_status() != PHP_SESSION_NONE && isset($_SESSION['your_var'])) {
        return $content;
    }

    and check the “my shortcode returns the value”.

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

The topic ‘PHP inside shortcodes’ is closed to new replies.