I have added a simple conditional to a custom field. It works as expected, however, the checkbox is now hidden on the post admin screen.
The field is a checkbox which is part of a field group.
Debug shows 'js-wpt-field wpt-field js-wpt-checkbox wpt-checkbox wpt-conditional-hidden js-wpt-remove-on-submit js-wpt-validation-ignore' with style for checbox data-wpt-id set to 'style="display: none;'
Value to show in the selected field is '<div class="badge-width item-badge"><span class="title-c">Editor's Choice</span>'
My conditional statement is '$(editor-s-choice) eq ‘item - badge’
Hello,
I have tried it in my localhost, there isn't the similar problem as you mentioned above:
the checkbox is now hidden on the post admin screen.
And since your custom checkbox field "editor-s-choice" stores numeric value "1", the "Data-dependent display filters" should use the value 1 too, for example:
($(editor-s-choice) eq 1)
You fixed it and I LOVE YOU! Thanks, Luo!
I spoke too soon. The field was showing in post admin, not it is not showing randomly.
🙁 I still love you, tho! (Pls help.)
Since there isn't the same problem in my localhost, please check these:
1) In case it is a compatibility problem, please deactivate all other plugins, and switch to wordpress default theme 2019, deactivate all custom PHP/JS code snippets, and test again
2) Also check if there is any PHP/JS error in your website:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/
3) If the problem still persists, please provide database dump file(ZIP file) of your website, also point out the problem page URL, I need to test and debug it in my localhost, thanks
https://toolset.com/faq/provide-supporters-copy-site/
Pret-ty sure it's fixed. I replaced
$(editor - s - choice) eq 1)
with
jQuery(editor - s - choice) eq 1)
and everything seems to be working. THANK YOU!
Thanks for sharing the solution.
In my localhost, it does not need to use jQuery, please let me know if you need more assistance for it.