Plugin section editor with multilingual content
-
I’m working on allowing users to edit a section of my plugin output in the admin area ( so it loads the default template code and they can customize it ). Initially I stored the customized template in the db, but this makes it impossible to make some text section multilingual.
There are some plugin functions that they can call in the template code like this {{my_plugin_function( $args )}} which is replaced with the output from the function when the output is shown on the front-end, but I can’t think of a way to make that work with texts for different languages when the template customizations are stored in the db.
Only thing I can think of is to create a new folder in the wp-uploads folder and store the template code there as .tmpl / .html or so, and esc_html__( ‘my_text’, ‘my_domain’ ) can be used. But this kind of feels wrong to me, isn’t the /wp-uploads folder only for image / file uploads? Or would it be acceptable for me to create a new folder there to store custom template sections?
- You must be logged in to reply to this topic.