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

Make compatible to embed into theme #7

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

theKhorshed
Copy link

I was trying to embed the plugin inside my theme but got issue with enqueueing the JS. I have tried to make the enqueue url compatible with both theme and plugin.

Thanks for the great work.

}

add_action('admin_enqueue_scripts', 'cmb2_conditionals_footer', CMB2_CONDITIONALS_PRIORITY);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the hook change but I do not understand why to move this out of the function. Can you @theKhorshed please explain it to me?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, It was actually not working inside the function. Probably because the function is called by the 'plugins_loaded' hook.

@jcchavezs
Copy link
Owner

Hi @theKhorshed - first of all, thanks a lot for contributing, I really like the fact that people try to add improvements proactively. Awesome!

/**
* Decides whether include the scripts or not.
*/
function cmb2_conditionals_footer()
function cmb2_conditionals_footer($hook)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvement. I was not aware of this.

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

Successfully merging this pull request may close these issues.

3 participants