Title: Conditional for custom function
Last modified: August 21, 2016

---

# Conditional for custom function

 *  [tuckerjoenz](https://wordpress.org/support/users/tuckerjoenz/)
 * (@tuckerjoenz)
 * [12 years ago](https://wordpress.org/support/topic/conditional-for-custom-function/)
 * I’m looking for a way to add a conditional for a snippet of code in a plugin.
   I want to check if it is set in the admin and if so show that data, if not show
   nothing. Here is my code:
 *     ```
       function display_manager_info() {
             // Some functional code
       }
       ```
   
 * in my html code I have this right now:
 * `<?php display_manager_info(); ?>`
 * So if there is nothing set, right now it has the div and labels showing empty.
   How in PHP/Wordpress is this done? I’m a newbie. Thanks for you help in advance.

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

 *  [J M](https://wordpress.org/support/users/hiphopinenglish/)
 * (@hiphopinenglish)
 * [12 years ago](https://wordpress.org/support/topic/conditional-for-custom-function/#post-4932515)
 * How is manager_info stuff stored? Theme options, post meta? That is how to determine
   your conditional call.
 * For example:
 *     ```
       function display_manager_info() {
             $display_info = get_option( 'has_manager_info' );
             if ($display_info) {
             // do your thing
             } else {
             // bail or do something else
       }
       ```
   
 *  Thread Starter [tuckerjoenz](https://wordpress.org/support/users/tuckerjoenz/)
 * (@tuckerjoenz)
 * [12 years ago](https://wordpress.org/support/topic/conditional-for-custom-function/#post-4932526)
 * Thanks for getting back to me. It’s stored in theme options. I think I understand
   you have done here and will give that a try. Thanks!

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

The topic ‘Conditional for custom function’ is closed to new replies.

## Tags

 * [conditional](https://wordpress.org/support/topic-tag/conditional/)
 * [functions](https://wordpress.org/support/topic-tag/functions/)
 * [if](https://wordpress.org/support/topic-tag/if/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [tuckerjoenz](https://wordpress.org/support/users/tuckerjoenz/)
 * Last activity: [12 years ago](https://wordpress.org/support/topic/conditional-for-custom-function/#post-4932526)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
