Random-Pokemon-Generator icon indicating copy to clipboard operation
Random-Pokemon-Generator copied to clipboard

Creating a WP-Plugin

Open Zavi499 opened this issue 1 year ago • 2 comments

Its not exactly an issue but a question , how can i convert this into WP-Plugin?

Zavi499 avatar Jun 23 '24 15:06 Zavi499

WP being WordPress? This fork might be a good starting point—it makes a REST API that you could use in a plugin. For WordPress, I believe you would need a PHP back end. I don't know if it's easy to add NodeJS or if you would need to run it somewhere else and have the WordPress plugin be a client.

Alternatively, you could start from the generateRandom() method in src/random.js. The important calls from there are getEligiblePokemon and chooseRandom. If you want this all in plain JavaScript without any NodeJS, you would need PHP to render and call JavaScript like that.

nerdydrew avatar Jun 24 '24 22:06 nerdydrew

Thank You Soo much for the detailed comment ❤️

Zavi499 avatar Oct 12 '24 15:10 Zavi499