admin管理员组

文章数量:1122832

A client wants to be able to partly customize the template output of a plugin in the admin area. This means he will see html / php code in an editor field.

I plan to strip out the tags listed here, but not sure what other measures I can take to prevent him from doing something stupid?

The part I struggle with is the best way to deal with the multilingual part. I thought of two possible routes.

  1. Save the templates in the database with an unique language id for each version. If he needs to have the templates in German, Spanish and English, then he will need to create 3 versions and assign the correct language to it.

  2. Save the custom templates in the /wp-uploads/my-plugin/ folder and use esc_html__() in the template code to make it translatable in different languages.

Anyone who ever had to deal with a request like this from a client?

Having executable code in the wp-uploads folder is probably not the way to go, but having x copies of the same template code in the database with only some words being in a different language also feels wrong.

What's the recommended way to deal with this?

本文标签: multi languageClient wants to be able to customize template with multilingual support