- This topic has 2 replies, 2 voices, and was last updated 7 years, 4 months ago by
Jason.
-
AuthorPosts
-
-
September 30, 2014 at 9:50 am #2504
JasonKeymasterGreetings!
I just ran into an interesting case where I’d like to change the meta-boxes for the default page template. Currently you can target a page template, or you can target the page post type. The problem with using the post type is that it applies to all page templates. On the other hand there is not “template” for the default template; it’s the absence of a template.
It’d be awesome to have a “Default” keyword for the template property. So one could target Template: Default.
For the internals, the best way to determine the default page template is to do:
if ( is_page() && !is_page_template() )Thanks!
-
September 30, 2014 at 10:24 am #2505
SteveKeymaster@jason– Would this tutorial help? It’s the opposite of what you want, but should get you started.
-
September 30, 2014 at 10:45 am #2506
JasonKeymaster@steve- Hmm.. well, I actually just added this to the Piklist core. I was more curious than anything. I’ll email this to you. You’re welcome to use it if you and Kevin feel that could be a reasonable part of the core. If you’d rather not use it, then I’ll just add this functionality to the PiklistHelper class.
I was thinking about the ‘piklist_add_part’ hook, but it didn’t occur to me to do $data[‘role’] = ‘no-role’ as a way of tricking Piklist into not showing it. To be honest, that feels a bit clunky to me. Why not allow the user to return false and add an if ( false === $data ) return; after the apply_filters?
Thanks!
~Jason
-
-
AuthorPosts
- You must be logged in to reply to this topic.