Title: If-else-condition
Last modified: October 6, 2016

---

# If-else-condition

 *  Resolved [GDY](https://wordpress.org/support/users/grandy/)
 * (@grandy)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/if-else-condition/)
 * 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)

 *  [Teodor Cosofret](https://wordpress.org/support/users/teodor-cosofret/)
 * (@teodor-cosofret)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/if-else-condition/#post-8260140)
 * 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](https://wordpress.org/support/users/grandy/)
 * (@grandy)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/if-else-condition/#post-8262988)
 * 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.
 *  [Teodor Cosofret](https://wordpress.org/support/users/teodor-cosofret/)
 * (@teodor-cosofret)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/if-else-condition/#post-8271391)
 * 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](https://wordpress.org/support/users/grandy/)
 * (@grandy)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/if-else-condition/#post-8274318)
 * 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 9 years, 6 months ago by [GDY](https://wordpress.org/support/users/grandy/).
    -  This reply was modified 9 years, 6 months ago by [GDY](https://wordpress.org/support/users/grandy/).
 *  [Teodor Cosofret](https://wordpress.org/support/users/teodor-cosofret/)
 * (@teodor-cosofret)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/if-else-condition/#post-8275716)
 * 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.

 * ![](https://ps.w.org/paid-member-subscriptions/assets/icon-256x256.png?rev=2961161)
 * [Paid Membership Subscriptions - Effortless Memberships, Recurring Payments & Content Restriction](https://wordpress.org/plugins/paid-member-subscriptions/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/paid-member-subscriptions/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/paid-member-subscriptions/)
 * [Active Topics](https://wordpress.org/support/plugin/paid-member-subscriptions/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/paid-member-subscriptions/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/paid-member-subscriptions/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Teodor Cosofret](https://wordpress.org/support/users/teodor-cosofret/)
 * Last activity: [9 years, 6 months ago](https://wordpress.org/support/topic/if-else-condition/#post-8275716)
 * Status: resolved