Hi @aparentdesign,
Thanks for reaching out to our support threads. Could you please try adding this filters to your functions.php file or any suitable place?
function add_extra_hooks( $allowed_functions ) {
$allowed_functions[] = 'is_single';
return $allowed_functions;
}
add_filter( 'widgetopts_allowed_php_functions', 'add_extra_hooks' );
Please let us know if the filters resolves the issue. We look forward to your response!
Kind Regards,
Mej, WIdget Options Team
Hey @aparentdesign,
Just a quick bump here. Could you please let us know if the filter provided above helps? Thanks!
Thx @mej, I have not put in the script yet since the function works for widgets that have not been edited. Unless your plugin update has blocked that script specifically and the other widgets are cached? Seems odd.
@mej I implemented the function, resaved the problem widget, cleared cache, and viewed in a fresh browser. The widget does not dispay on the intended page. Other widgets that have not been edited seem ok.
Again this is something that happened on a previous update and was fixed at one point. Non admins should be able to edit widgets even if they are not accessing or trying to change conditional logic.
Hi @aparentdesign,
Upon further testing with the User Role Editor and the Widget Options plugin, it appears that non-admin users modified by the User Role Editor are still able to edit widgets. Could you please let us know which specific Widget Options features you’re using with non-admin roles so we can run the same tests on our end? Thanks!
Are they able to edit widgets without wiping out conditional code? And is an admin able to add the code back in successfully?
Hi @aparentdesign,
Yes, upon further testing, non-admin users modified through the User Role Editor can still edit widgets, and administrators can still add conditional logic codes.
To help us replicate the issues you’re experiencing, could you please provide a detailed workflow or the exact steps you’re taking on your end?
Thanks!
Hi @mej , to reiterate, the user edited a widget. This wiped out the conditional code, and when the admin put it back, it no longer worked.
Is there some setup in User Role Editor that we need to apply to work with your plugin? Which setting to allow?
Hi @aparentdesign,
Thanks for the clarification. I’ve created a video reference demonstrating the behavior when a non-admin user—modified with the User Role Editor—edits a widget. In our tests, the non-admin user does not wipe or remove the Conditional Code that was previously added and saved by an Administrator.
In the screen recording, we were regrettably unable to replicate the issue you described regarding the Conditional Logic tab being cleared. Could you please confirm if we followed the same workflow you used when the issue occurred? Any additional steps or details will help us reproduce the problem accurately on our end.
Screen Record link here: https://streamable.com/o6rq4r
The conditional logic used is is_category() && !is_page(), where the widget only shows on post categories, which is working fine as expected. Please note that we also tested this on classic widgets and it is producing the same output.
Thanks, and we look forward to your response.
Kind Regards,
Mej, Widget Options Team