Wordpress/Elementor/PHP Code Widget: PHP code is not execute and everything after "=>" renders as plain text when I am logged out
21:47 13 Nov 2017

I want to execute some PHP code in an WordPress Elementor template with the PHP Code Widget. Everything works fine as long as I am logged in.

If I log out, the code is not executed and everything after "=>" shows as plain text.

So e.g. the code

 'bar'];
    echo 'after';
?>
some HTML

would result in the following string:

 'bar']; echo 'after'; ?>

The HTML after this is fine.

If I place the same code in another widget outside of Elementor (e.g. the footer of the theme), everything also works fine.

I am the admin of this single WordPress installation.

Has anyone an idea, how to stop this behaviour?

php wordpress widget elementor