Make WordPress Core

Changes between Version 1 and Version 2 of Ticket #13265, comment 43


Ignore:
Timestamp:
02/25/2014 06:37:23 PM (11 years ago)
Author:
downstairsdev
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #13265, comment 43

    v1 v2  
    33That's the use case I have with a project.  I'd like to make certain page templates in the theme available only if portfolio post types are active on the site.  I'm working around the lack of filter with javascript for the moment:  http://wptheming.com/?p=14753
    44
    5 Below I attached a plugin that uses the page_templates filter to remove a template from TwentyFourteen from the drop down list (page-templates/contributors.php): https://core.trac.wordpress.org/attachment/ticket/13265/core-remove-page-templates.php
     5Below I attached a plugin that uses the page_templates filter to remove a template from TwentyFourteen (page-templates/contributors.php): https://core.trac.wordpress.org/attachment/ticket/13265/core-remove-page-templates.php
    66
    7 If that specific template has been selected for the page the #page-template select box will default to "Default Template".  However, the actual template loaded on the page does not update until the post is re-saved.
     7If that specific template has been selected for the page the #page-template select box will default to "Default Template"- but the actual template loaded on the page does not update until the post is re-saved.
    88
    99I also tested @wpsmith's plugin.  I was able to select the "test" page template successfully from the admin- however, the template did not appear to load "test.php" template on the front end.  Perhaps a little more work is needed?  I'll see if I can find a solution.