# The PHP Condition

Original URL: https://www.fireplugins.com/docs/display-conditions/php/
Last updated: 2025-07-31T12:37:32+03:00

The PHP Condition lets you write your own PHP code and return a true or false to display or hide the popup from the current page.

  You can find a collection of ready-to-use PHP scripts [here](https://fireplugins.com/docs/general/extending-general/custom-php-assignments/).

 ## Notes

 When trying to compare against the current post/page, you should use the following snippet:

 ```
global $post;
wp_reset_postdata();
// Use $post to run your checks against the current post/page
return $post->post_type === 'post';
```

 The reason is that when using just **global $post**, or **get_post()**, it will always return the FireBox post instance and not the parent.

 ## Use Case

 This rule is rather useful if you want to display a popup on scenarios such as if the user has a total of X on their cart and you want to provide an upsell or coupon or anything of that nature. This gives you the flexibility to display a popup under almost any circumstance.
