#8497 closed enhancement (fixed)
support single-lined Template Name comment blocks for Templates
Reported by: | DD32 | Owned by: | westi |
---|---|---|---|
Milestone: | 2.8 | Priority: | normal |
Severity: | normal | Version: | 2.7 |
Component: | Themes | Keywords: | has-patch needs-testing |
Focuses: | Cc: |
Description
at present, The Template system requires that the Template Names are on their own lines, Eg:
/* Template Name: Snarfer */
Using something such as:
/* Template Name: Snarfer */
or
<?php // Template Name: Snarfer ?>
will result in Snarfer */ and Snarfer ?> respectively.
The attached patch causes the template locator to ignore anything after a closing comment marker(*/) as well as end-php markers(?>)
(As promised for Anthony)
Attachments (5)
Change History (17)
#4
@
15 years ago
- Keywords needs-patch added
Denis, I take the new patch is intending to apply this rule to all the other headers?
If so, we should create a cleanup function containing the regex call and just call that.
Named something like _cleanup_header_comment() but preferably snapier!
#7
@
15 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
oh, you just committed it. I had noticed a potential potential cron job issue. new patch against current trunk arriving in a sec.
#8
@
15 years ago
the cron that checks for theme updates uses get_themes(), so we need to make sure the function is defined when that gets triggered.
#9
@
15 years ago
there. fixes both the theme and the plugin update check cron -- else we'd get fatal errors when they're triggered from the front end.
#10
@
15 years ago
I think I would prefer to move the new function to wp-includes/functions.php where it will always be available.
I transposed the minor digits in the patch name.. but rest assured, Its for this ticket.