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

Fix main class, allows loading on options pages #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JayWood
Copy link

@JayWood JayWood commented Sep 13, 2016

Pretty much a rewrite of the main initializing class. Used CMB2 as a staple for this sort of thing. The previous main class wouldn't allow us to use the plugin on an options page. It now does.

  • Version bump to 1.2.5
  • Using singleton pattern now
  • Now firing only on cmb2_init, not after_setup_theme

@jtsternberg I know you originally had a hand in here, so if you get time to review that'd be amazing.

@jtsternberg
Copy link
Member

jtsternberg commented Sep 13, 2016

This will completely break the loader functionality as you are not actually using the PRIORITY constant which is what makes most of the magic work.

You'd be better off using the newer loader that I have in the wds-shortcodes plugin: https://github.com/WebDevStudios/WDS-Shortcodes/blob/master/wds-shortcodes.php#L112-L118
(this is all based on wp-lib-loader, and the version in this plugin is old)

It hooks into the first available hook, depending on when the file is loaded, which is what you're looking for.
https://github.com/WebDevStudios/WDS-Shortcodes/blob/master/wds-shortcodes.php#L112-L118

@JayWood
Copy link
Author

JayWood commented Sep 13, 2016

@jtsternberg awesome, thanks for the info

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.

2 participants