Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help Including Callback Function in Plugin Boilerplate #571

Open
GermanPearls opened this issue Oct 7, 2021 · 1 comment
Open

Help Including Callback Function in Plugin Boilerplate #571

GermanPearls opened this issue Oct 7, 2021 · 1 comment

Comments

@GermanPearls
Copy link

Trying the boilerplate for the first time and am running into problems with including functions used in hooks.

Here's what I did:

  1. created call back function, 'call-back-function'
  2. 'call-back-function' saved in a callback-functions.php file
  3. in includes/class-plugin-name.php file, I have:

require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/callback-functions.php';

  1. in includes/class-plugin-name.php file, in define_public_hooks function I included:

$this->loader->add_action( 'frm_after_create_entry', $plugin_public, 'call-back-funciton', 30, 2);

But, the hook can't find the call-back-function. I get an error:

call_user_func_array() expects parameter 1 to be a valid callback....

What am I missing / doing wrong?

@christiespeich
Copy link

call-back-function should be a function in the class {plugin_name}_Public

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants