• Resolved GDY

    (@grandy)


    Is there a way to use a function in a if else statement in the theme code?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi,

    Thank you for reaching out to us.

    Can you give me more details regarding what are you trying to achieve?

    Best regards,

    Thread Starter GDY

    (@grandy)

    We wan’t to create a download area that is only accessible with a pro plan. But its only partial and not a whole page/post.

    So we wanted to create a if-else-statement in a page template (or content module) that shows the download or – if the user has no pro plan – a custom message.

    In both cases it should be html and not a plain text.

    Hi,

    Thank you for explaining what are you trying to achieve.

    For the moment we can’t restrict content based on a functionality using a PHP function.

    I forwarded your request to our dev team and in future updates this will be possible.

    I am sorry for the inconvenience but for the moment I don’t have a solution for your request.

    Best regards,

    Thread Starter GDY

    (@grandy)

    Hi Teodor,

    thanks that is nice to hear.

    Great would be a function like this:

    pms_has_subscription( $subscription_id, $user_id = get_current_user_id() )

    usable like so:

    if( pms_has_subscription( '1' ) ): or if( pms_has_subscription( array( 1, 2 ) ) ):

    The user id should be optional and by default the current user id. Even the first parameter could be optional so if not set the user just need any pms subscription.

    Greetings GDY

    • This reply was modified 8 years, 1 month ago by GDY.
    • This reply was modified 8 years, 1 month ago by GDY.

    Hi GDY,

    Thank you for your suggestion.

    I will forward it to the dev team. They will decide how this request will be implemented.

    Best regards,

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘If-else-condition’ is closed to new replies.