Title: Shortcode inside pluggable function?
Last modified: August 22, 2016

---

# Shortcode inside pluggable function?

 *  Resolved [Artus](https://wordpress.org/support/users/tintalent/)
 * (@tintalent)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/shortcode-inside-pluggable-function/)
 * Is it possible to make a shortcode work inside a pluggable function? like:
 *     ```
       if (!function_exists('ausers_format_user_some_info')) {
        function ausers_format_user_some_info($v, $u) {
   
        return do_shortcode ('[some-shortcode]');
   
        else return ($v);
       }
        }
       ```
   
 * [https://wordpress.org/plugins/amr-users/](https://wordpress.org/plugins/amr-users/)

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

 *  Plugin Author [anmari](https://wordpress.org/support/users/anmari/)
 * (@anmari)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/shortcode-inside-pluggable-function/#post-5889720)
 * Sorry artus, my mind boggled at this question when I first saw it and I was struggling
   to find a more informative way to say “No”
 * whatever shortcode you are trying to use is actually just using a function. Most
   shortcodes expect themselves to be in a page context and would probably not work
   meaningfully when called multiple times in one page.
 * A much much better solution would be to inspect the code that does the shortcode.
   somewhere it will say something like
 *     ```
       //[foobar]
       function foobar_func( $atts ){
       	return "foo and bar";
       }
       add_shortcode( 'foobar', 'foobar_func' );
       ```
   
 * eg: from [http://codex.wordpress.org/Shortcode_API](http://codex.wordpress.org/Shortcode_API)
 * what you want then is the foobar_func and you want to be sure you have set up
   whatever situation the shortcode expects to be operating in.
 *  Thread Starter [Artus](https://wordpress.org/support/users/tintalent/)
 * (@tintalent)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/shortcode-inside-pluggable-function/#post-5889722)
 * Great, I understand it better, thanks for the link.

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

The topic ‘Shortcode inside pluggable function?’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/amr-users_f6f6f4.svg)
 * [amr users](https://wordpress.org/plugins/amr-users/)
 * [Support Threads](https://wordpress.org/support/plugin/amr-users/)
 * [Active Topics](https://wordpress.org/support/plugin/amr-users/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/amr-users/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/amr-users/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Artus](https://wordpress.org/support/users/tintalent/)
 * Last activity: [11 years, 1 month ago](https://wordpress.org/support/topic/shortcode-inside-pluggable-function/#post-5889722)
 * Status: resolved