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

Any reason not to support option pages? #57

Open
asadkn opened this issue May 23, 2018 · 4 comments
Open

Any reason not to support option pages? #57

asadkn opened this issue May 23, 2018 · 4 comments

Comments

@asadkn
Copy link

asadkn commented May 23, 2018

There seems to be no support for option pages by default. Is there any reason why not?

It can be added by modifying the cmb2-conditionals.js file with:

CMB2ConditionalsInit('.cmb2-options-page', '.cmb2-options-page .cmb-field-list');

And by adding the cmb2-conditional.js enqueu manually in the plugins. Now adding the enqueue is easy, but the JS code should exist in cmb2-conditionals.js by default so it doesn't have to be modified.

@pogla
Copy link

pogla commented Jul 10, 2018

@asadkn Change this line to:

CMB2ConditionalsInit( '.cmb-form' );

Also, you will have to change this line to something like:

if ( 'admin.php' !== $GLOBALS['pagenow'] || 'arp_options' !== $GLOBALS['plugin_page'] ) {
  return;
}

Or just remove it.

@tw2113
Copy link

tw2113 commented Jul 31, 2018

Sorry for the GH issue noise, but thanks for the two pointers above for getting this working on options pages. Just what I was needing.

@jcchavezs
Copy link
Owner

jcchavezs commented Aug 1, 2018 via email

@pogla
Copy link

pogla commented Aug 4, 2018

@jcchavezs Sure: #59

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

4 participants