mundschenk-at / wp-typography

Improve your WordPress micro typography.

Home Page:https://code.mundschenk.at/wp-typography/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add hook for adding more setting pages

strarsis opened this issue · comments

It would be nice if other plugins could extend wp-typography by adding further setting pages,
e.g. grouped words.

Could you please describe a possible usecase for this feature? Injecting arbitrary options could be a security risk.

@mundschenk-at: Yes! For example a plugin that adds an option page to wp-typography that allows to define words that should stay grouped (wrapped in an element). I needed this on multiple sites and currently use a plugin with some hard-coded values in an array (which already uses some of wp-typography features).

I'm not sure I really understand the usecase. Why not have your own settings page for this plugin? (You're not using the typo_configuration option array, I presume.)

I could add some action hooks that trigger after the plugin options are rendererd, but before the buttons. However, you'd still need to do everything else yourself.

@mundschenk-at: Yes, it would be OK to just being able to inject an extra tab (and its contents) so the user can find the word-grouping settings also in the site typography settings.

It might be possible to extend the tabs via a filter hook. I'll look into this.

It's not looking good, everything is pretty tightly coupled with the WordPress Settings API. To be able to truly extend the settings page, I'd have to add filter hooks for all parts (tabs, sections, individual controls etc.). Even if it were possible to do this in a secure manner, it would be quite a lot of work. I'm not ruling it out completely, but its definitely on the back burner at the moment.

After thinking about this more thoroughly, I can't think of any way to implement this without creating a huge security issue (option injection).