MathiasAeschlimann
Member
Posted 1 year ago #
I have a custom post type products and I have a CKEditor template product. If someone clicks on 'Add New Product' I would like to have the editor autoload that template. This template should not autoload on other post types/pages.
How do I achieve that?
dczepierga
Member
Posted 1 year ago #
Hi,
If u want to do something like this u must write 2 script: in PHP and JavaScript.
In PHP only for post type products u must load your JavaScript file. (so you u must write a little plugin to WordPress here)
In JavaScript u must write autoloading of template products.
And now i don't know that u want to only add button to choose template and use it or you want to load template product to editor without any user action?
Greetings