php – How do I use the Simple HTML DOM Parser in plugin when other plugin already uses it?


In a plugin I am currently coding, I want to use the Simple HTML DOM Parser library. However, when I include it

require(CPS_PLUGIN_PATH . '/vendor/simple_html_dom.php');

I get this error:

Fatal error: Cannot redeclare file_get_html() (previously declared in /www/htdocs/12345/ in /www/htdocs/12345/ on line 54

So obviously the Fast Velocity Minify plugin is already using it. What do I do here, if I don’t want to mess around in the library itself? What’s the best practice in a case like this?

TheKidsWantDjent 2 years 2022-01-31T20:37:32-05:00 0 Answers 0 views 0

Leave an answer