Title: Shortcode not returning the value
Last modified: April 5, 2020

---

# Shortcode not returning the value

 *  Resolved [Jeffinho2016](https://wordpress.org/support/users/jeffinho2016/)
 * (@jeffinho2016)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/shortcode-not-returning-the-value/)
 * So I recently came across this weird bug.
    here’s the function that I’m calling
   through shortcode in a cell. [http://sandbox.onlinephpfunctions.com/code/10f6e05d1403e6d7944a1bede31b007312584f39](http://sandbox.onlinephpfunctions.com/code/10f6e05d1403e6d7944a1bede31b007312584f39)
 * My cell looks like this: [https://i.imgur.com/yrczNQi.jpg](https://i.imgur.com/yrczNQi.jpg)
 * Whenever I fell in the situation return ‘No’,
    The ‘No’ was not returned to the
   tablepress, but was echoed in the page. If I fell in the other case, no worries
   at all, the value was returned into the cell.
 * Now, if I allow PHP in the cells and just call the function like this: [https://i.imgur.com/IrsQYJx.jpg](https://i.imgur.com/IrsQYJx.jpg)
 * It works, the ‘No’ is correctly displayed in the cell.
    I think you have an issue
   somewhere. Reverted to 1.10, but it’s still there so it’s not due to the last
   update

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

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/shortcode-not-returning-the-value/#post-12631796)
 * Hi,
 * thanks for your post, and sorry for the trouble.
 * This sounds strange, and I don’t really see how TablePress could be causing this
   to be honest… It just doesn’t have any functions that could be causing that early
   output of the content… Also, it doesn’t know what’s happening inside your Shortcode,
   it just gets the value.
 * I really suggest to try this again, as the Shortcode approach is much safer than
   allowing PHP code.
 * Note that it might be good to turn off the TablePress output cache for this table,
   so that you always get an up to date Shortcode value. For this, you should embed
   the table with the extended Shortcode
 *     ```
       [table id=123 cache_table_output=false /]
       ```
   
 * Regards,
    Tobias
 *  Thread Starter [Jeffinho2016](https://wordpress.org/support/users/jeffinho2016/)
 * (@jeffinho2016)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/shortcode-not-returning-the-value/#post-12632381)
 * Hi Tobias, I should have made more testing before writing this message sorry.
   
   Turns out I have the exact same issue with my “return” transforming into an “
   echo” if I launch the shortcode outside of tablepress. So it has indeed nothing
   to do with your plugin. Yet, incredibly weird as it’s the first time ever I’m
   encountering that. My apologies.
 *  Thread Starter [Jeffinho2016](https://wordpress.org/support/users/jeffinho2016/)
 * (@jeffinho2016)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/shortcode-not-returning-the-value/#post-12632814)
 * Turns out the same shortcode was mapped to 2 functions haha.
    sorry!
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/shortcode-not-returning-the-value/#post-12633076)
 * Hi,
 * ah, great find! I would never have guessed that! I hadn’t even realized that 
   a Shortcode might be mapped to two functions! Good catch!
 * Best wishes,
    Tobias
 * P.S.: In case you haven’t, please [rate TablePress](https://wordpress.org/support/plugin/tablepress/reviews/#new-post)
   here in the plugin directory. Thanks!

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

The topic ‘Shortcode not returning the value’ is closed to new replies.

 * ![](https://ps.w.org/tablepress/assets/icon.svg?rev=3192944)
 * [TablePress - Tables in WordPress made easy](https://wordpress.org/plugins/tablepress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/tablepress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/tablepress/)
 * [Active Topics](https://wordpress.org/support/plugin/tablepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/tablepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/tablepress/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [6 years, 2 months ago](https://wordpress.org/support/topic/shortcode-not-returning-the-value/#post-12633076)
 * Status: resolved