Conversation
supportThanks for this handy tool. I stumbled upon some problems during testing: 1. I got some PHP errors like this “Use of undefined constant option_2 – assumed ‘option_2’ in viewer.php on line 107”. You have to set the parameters for “option_1” and “option_2” in quotes. Also there’s an error for line 26 where you call “get_fields(option)”. The parameter should also set into quotes. 2. On the theme I tested the plugin, the header has a very high z-index and therefore I can’t see the toggle button to open ACF viewer on front end. I changed the z-index for #acfv-wrap (line36) and #acfv-toggle (line199) to “999999” and for #acfv-click-layer to “999998” in all theme CSS files and now it works. Hope this helps for improving your plugin Thomas https://wordpress.org/plugins/advanced-custom-fields-viewer/
Here are all the location to fix: Line 26: get_fields(option) should be get_fields('option') Line 52: $output[option_1] should be $output['option_1'] Line 55: $output[option_1] should be $output['option_1'] Line 66: $output[option_1] should be $output['option_1'] Line 69: $output[option_1] should be $output['option_1'] Line 82: $output[option_1] should be $output['option_1'] Line 84: $output[option_1] should be $output['option_1'] Line 107: $theme[option_2] should be $theme['option_2'] Line 109: $theme[option_2] should be $theme['option_2'] You are lucky that it works because if only one of these constants exists (option, option_1, option_2), it will break everyhting.
Got the same notices: 1) Notice: Use of undefined constant option – assumed ‘option’ in /wp-content/plugins/advanced-custom-fields-viewer/viewer.php on line 26 2) Notice: Use of undefined constant option_1 – assumed ‘option_1’ in /wp-content/plugins/advanced-custom-fields-viewer/viewer.php on line 52 3) Notice: Use of undefined constant option_2 – assumed ‘option_2’ in /wp-content/plugins/advanced-custom-fields-viewer/viewer.php on line 107 By using VARDUMP one more notice appears: 4) Notice: Use of undefined constant option_1 – assumed ‘option_1’ in /wp-content/plugins/advanced-custom-fields-viewer/viewer.php on line 55
Thank you all for your input. I really do appreciate it! I have just released 1.1.4 with fixes to those issues. Please let me know if those have been resolved for you in the update. 🙂
Resolved.
Here are all the location to fix: Line 26: get_fields(option) should be get_fields('option') Line 52: $output[option_1] should be $output['option_1'] Line 55: $output[option_1] should be $output['option_1'] Line 66: $output[option_1] should be $output['option_1'] Line 69: $output[option_1] should be $output['option_1'] Line 82: $output[option_1] should be $output['option_1'] Line 84: $output[option_1] should be $output['option_1'] Line 107: $theme[option_2] should be $theme['option_2'] Line 109: $theme[option_2] should be $theme['option_2'] You are lucky that it works because if only one of these constants exists (option, option_1, option_2), it will break everyhting.
Got the same notices: 1) Notice: Use of undefined constant option – assumed ‘option’ in /wp-content/plugins/advanced-custom-fields-viewer/viewer.php on line 26 2) Notice: Use of undefined constant option_1 – assumed ‘option_1’ in /wp-content/plugins/advanced-custom-fields-viewer/viewer.php on line 52 3) Notice: Use of undefined constant option_2 – assumed ‘option_2’ in /wp-content/plugins/advanced-custom-fields-viewer/viewer.php on line 107 By using VARDUMP one more notice appears: 4) Notice: Use of undefined constant option_1 – assumed ‘option_1’ in /wp-content/plugins/advanced-custom-fields-viewer/viewer.php on line 55
Thank you all for your input. I really do appreciate it! I have just released 1.1.4 with fixes to those issues. Please let me know if those have been resolved for you in the update. 🙂
Resolved.