Support » Plugin: Classic Text Widget » PHP-code?

  • Resolved DS


    Your plugin is great, but I hurried to rejoice and rewrite my widgets. After refreshing the page, PHP code does not work again, as if I saved it in a visual editor. Outwardly classic text widget looks like the old widget, but the php code is not supported in it. Is there any solution to this issue? Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Victor Font


    The classic text widget is the widget from WordPress 4.7.5 rewritten as a plugin. Nothing in the functionality changed from what it was in WordPress 4.7.5, so no, it does not directly support executing PHP. The widget does support shortcodes however. If you want to execute PHP in this widget, add your code as a shortcode and it will run.

    Thread Starter DS


    You are absolutely right. Sorry, I’m not a programmer at all, I do not understand php, so I did not immediately understand the reason. I have long connected the support of php-code in text widgets, and now I was sure that php in the widget will work as before. But I did not consider that now the widget is called otherwise. Now I solved the problem. I added to:
    add_filter('widget_text', 'php_in_widgets', 99);
    one more:
    add_filter('classic_widget_text', 'php_in_widgets', 99);
    to the functions.php.
    Now everything works.
    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘PHP-code?’ is closed to new replies.