Title: Echo variables inside a function
Last modified: August 19, 2016

---

# Echo variables inside a function

 *  [John Peden](https://wordpress.org/support/users/jcpeden/)
 * (@jcpeden)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/echo-variables-inside-a-function/)
 * Just started making inroads into coding my first plugin. I’ve got a widget that
   displays three tabs of post titles in a tabbed menu. The first tab currently 
   displays the most commented posts written in the last 30 days. I’m using this
   filter:
 *     ```
       $where .= " AND post_date > '" . date('Y-m-d', strtotime('-30 days')) . "'";
       ```
   
 * I’d like to make the 30 days a user configured variable but don’t know how to
   echo this variable within the where filter.
 * How can I make it work?

The topic ‘Echo variables inside a function’ is closed to new replies.

## Tags

 * [variable](https://wordpress.org/support/topic-tag/variable/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [John Peden](https://wordpress.org/support/users/jcpeden/)
 * Last activity: [15 years, 8 months ago](https://wordpress.org/support/topic/echo-variables-inside-a-function/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
