Title: PHP Function
Last modified: November 9, 2022

---

# PHP Function

 *  Resolved [donald91](https://wordpress.org/support/users/donald91/)
 * (@donald91)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/php-function-14/)
 * Is there a function provided to check, if the current IP is set up in the plugin
   settings? E.g. I want to show some stuff only if user is logged in by the plugin.
   (
   I can of course use a function based on the username as an alternative, but thought
   of something like “if(is_in_IP_range())” or similar.

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

 *  [msamavi](https://wordpress.org/support/users/msamavi/)
 * (@msamavi)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/php-function-14/#post-16180187)
 * I am interested as well.
 *  Plugin Author [brijeshk89](https://wordpress.org/support/users/brijeshk89/)
 * (@brijeshk89)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/php-function-14/#post-16188042)
 * Hi,
 * We do have a function is_logged_in_using_ipbl() which returns true if the current
   logged in user was logged in by IP Based Login plugin.
 * Let us know if you have any questions.
 *  Thread Starter [donald91](https://wordpress.org/support/users/donald91/)
 * (@donald91)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/php-function-14/#post-16188469)
 * Thanks, that worked. Would be great to have this in the documentation, could 
   not find it 🙂
 *  Plugin Author [brijeshk89](https://wordpress.org/support/users/brijeshk89/)
 * (@brijeshk89)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/php-function-14/#post-16189013)
 * Hi,
 * Glad to know it worked!
 * It is documented in the overview section of WordPress Plugins page :
    [https://wordpress.org/plugins/ip-based-login/](https://wordpress.org/plugins/ip-based-login/)
 * Will try to make it more prominent.
 *  [msamavi](https://wordpress.org/support/users/msamavi/)
 * (@msamavi)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/php-function-14/#post-16189752)
 * Hi,
 * Can you please provide a simple usage example? I wish to try it as a php snippet.
 * Thanks
 *  Thread Starter [donald91](https://wordpress.org/support/users/donald91/)
 * (@donald91)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/php-function-14/#post-16189878)
 * You can use e.g.
 *     ```
       if(is_logged_in_using_ipbl()) {
       echo 'user is logged in via Plugin';
       } else {
       echo 'you need to login';
       }
       ```
   

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

The topic ‘PHP Function’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/ip-based-login.svg)
 * [IP Based Login](https://wordpress.org/plugins/ip-based-login/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ip-based-login/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ip-based-login/)
 * [Active Topics](https://wordpress.org/support/plugin/ip-based-login/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ip-based-login/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ip-based-login/reviews/)

 * 6 replies
 * 3 participants
 * Last reply from: [donald91](https://wordpress.org/support/users/donald91/)
 * Last activity: [3 years, 6 months ago](https://wordpress.org/support/topic/php-function-14/#post-16189878)
 * Status: resolved