Hi @palpatine1976,
Please check the changes in this pull request and let me know if it also works for you!
https://github.com/cleverness/widget-css-classes/pull/27
Thanks, Jory
Thread Starter
Twig
(@palpatine1976)
Hi @keraweb –
Thanks for the link, but it’s giving me an angry unicorn right now 🙂
Is that repo public?
Yep it should be visible to anyone!
Looks like a great plugin with some great features, but I’m having conflict with “Code PHP in Widget” plugin. So I suspect the conflict count is now two, sorry to say.
Hi @ddarby14
I have checked the plugin “Code PHP in Widget” and am sorry to say this is a “fault” of this plugin not correctly handling widget data.
It completely ignores any before_widget
and after_widget
parameters (https://codex.wordpress.org/Widgets_API) and doesn’t provide any hooks so it’s impossible for other plugins to integrate with this one.
Please file a bug report there so the dev can fix it (although the plugin seems abandoned to me).
Sorry that we can’t help you with this one.
Regards, Jory
@ddarby14,
I found another (way more popular) plugin that does the same and is compatible:
https://wordpress.org/plugins/php-code-widget/
This plugin also isn’t updated for a long time but the author did update the readme recently (before WP 4.8) so I assume development is still active.
Hope this helps.
Regards, Jory
Hey Jory, thanks for the extra. I had checked out that and 2 others, all outdated. The older PHP Text Widget was wonky, but the only one pseudo-working. But I went back to check that php code widget and still had problems. Oy. So I punted and we converted the php to shortcode which was needed anyway. The classes work great, no conflict. Thanks so much. Rating added.
Replied in your review, thanks!
To add upon this. It is always better to use shortcodes or custom widgets. Adding PHP code in a widget will save the code into the database which is then run through PHP’s function eval()
which is discouraged for safety reasons.
More info here: http://php.net/manual/en/function.eval.php