Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

How do I register a new page in the $templatelangkeys array?

0 votes
2,973 views
asked Jul 26, 2012 in Plugins by Fox Cameron

Note:
This question also references:
http://www.question2answer.org/qa/15588/can-i-make-a-new-widget-on-a-specific-custom-page-module

Me and a fellow user (in the question referenced above) want to use a custom widget on a custom plugin page without having that widget appear in every "position on all available pages". Interestingly when we both create a plugin page we cannot exclusively feature a plugin on a custom plugin page. It appear that the array $templatelangkeys defined in qa-page-admin-widgets.php (that contains the avaliable pages a widget may appear on) does not automatically update when there is a new plugin page avaliable. This can be demonstrated when trying to add a plugin widget to a plugin page under admin -> layout -> add widget - the plugin page simply isn't avaliable.

My question: Is there a method to add a plugin page to the $templatelangkeys before it is rendered on Admin -> Layout -> Add Widget under: Show widget in this position on the following pages?

1 Answer

0 votes
answered Aug 3, 2012 by gidgreen
I'm afraid there is currently no easy way to do this, without a layer which modifies the HTML output.
commented Aug 3, 2012 by Fox Cameron
Yes, it looks like this area (the templating system) is generally a barebones and development has been prioritized elsewhere. Thanks for the feedback.
...