Title: Pods Template function callback
Last modified: August 8, 2019

---

# Pods Template function callback

 *  Resolved [dameer.dj](https://wordpress.org/support/users/dameerdj/)
 * (@dameerdj)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/pods-template-function-callback/)
 * Hi,
    so far I have had something like this in my custom Pods Template:
 * `{@ID,kka_get_pods}`
 * …which worked just fine. “kka_get_pods” is the function in my theme’s “functions.
   php” and returns a chunk of HTML.
 * However, I had to move “kka_get_pods” function to the plugin due to the fact 
   that certain things belong to plugin territory. Anyhow…
 * The question is: how do I call/access my function that is now part of the plugin?
 * I’ve tried:
 * `{@ID,My_Plugin::kka_get_pods}`
 * …but it doesn’t seem to work.
 * My function is public and declared inside the class. Somewhat standard thing.
 *     ```
       class My_Plugin {
   
       	private static $instance;
   
       	public static function get_instance() {
   
       		if( ! self::$instance ) {
   
       			self::$instance = new self();
       			self::$instance->init();
   
       		}
   
       		return self::$instance;
   
       	}
   
       	public function init() {
   
       		// nothing to init yet
   
       	}
   
       	public function kka_get_pods() {
   
       		// code
   
       	}
   
       }
       ```
   

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

 *  Plugin Author [Jory Hogeveen](https://wordpress.org/support/users/keraweb/)
 * (@keraweb)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/pods-template-function-callback/#post-11812090)
 * Hello [@dameerdj](https://wordpress.org/support/users/dameerdj/) ,
 * `My_Plugin::kka_get_pods` is a static call so you need to declare your function
   as static: `public static function kka_get_pods()`.
    I’m actually uncertain whether
   this will work at all but since static calls work relatively similar to regular
   functions I think it might!
 * Regards, Jory
 *  Thread Starter [dameer.dj](https://wordpress.org/support/users/dameerdj/)
 * (@dameerdj)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/pods-template-function-callback/#post-11812269)
 * Forgot to mention that I already tried to declare it as a static function and
   it didn’t work as well.
 * Is there any workaround to the problem? I mean, you are Pods developer, there
   must be something.
 * Thanks for any hint in advance!
 *  Plugin Author [Jory Hogeveen](https://wordpress.org/support/users/keraweb/)
 * (@keraweb)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/pods-template-function-callback/#post-11812463)
 * I found a bottleneck in the code. It validates through `function_exists` and 
   in your case it’s not a function.
 * A workaround for now is to create a function within your plugin that calls the
   class method.
 * I’ve made a PR on GitHub to discuss this topic with a possible solution.
    [https://github.com/pods-framework/pods/pull/5437](https://github.com/pods-framework/pods/pull/5437)
 * I’ll close this topic here in favor of GitHub. Thanks for your report!
 * Cheers, Jory
 *  Plugin Author [Scott Kingsley Clark](https://wordpress.org/support/users/sc0ttkclark/)
 * (@sc0ttkclark)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/pods-template-function-callback/#post-11812886)
 * We’ve merged this PR into our next maintenance release going out this month. 
   Thanks for your understanding here [@dameerdj](https://wordpress.org/support/users/dameerdj/)
 *  Thread Starter [dameer.dj](https://wordpress.org/support/users/dameerdj/)
 * (@dameerdj)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/pods-template-function-callback/#post-11815303)
 * That’s awesome, thanks a lot guys!!!

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

The topic ‘Pods Template function callback’ is closed to new replies.

 * ![](https://ps.w.org/pods/assets/icon.svg?rev=3286397)
 * [Pods - Custom Content Types and Fields](https://wordpress.org/plugins/pods/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pods/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pods/)
 * [Active Topics](https://wordpress.org/support/plugin/pods/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pods/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pods/reviews/)

## Tags

 * [callback](https://wordpress.org/support/topic-tag/callback/)
 * [class](https://wordpress.org/support/topic-tag/class/)
 * [template](https://wordpress.org/support/topic-tag/template/)

 * 5 replies
 * 3 participants
 * Last reply from: [dameer.dj](https://wordpress.org/support/users/dameerdj/)
 * Last activity: [6 years, 9 months ago](https://wordpress.org/support/topic/pods-template-function-callback/#post-11815303)
 * Status: resolved