Ticket #8497 (closed enhancement: fixed)
support single-lined Template Name comment blocks for Templates
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 2.8 |
| Component: | Themes | Version: | 2.7 |
| Severity: | normal | Keywords: | has-patch needs-testing |
| 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
Change History
I transposed the minor digits in the patch name.. but rest assured, Its for this ticket.
- 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!
- Status changed from assigned to closed
- Resolution set to fixed
- Status changed from closed to reopened
- Resolution fixed deleted
oh, you just committed it. I had noticed a potential potential cron job issue. new patch against current trunk arriving in a sec.
the cron that checks for theme updates uses get_themes(), so we need to make sure the function is defined when that gets triggered.
Denis-de-Bernardy — 3 years ago
-
attachment
8497-cron.diff
added
fix both themes and plugins update cron
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.
comment:10
westi — 3 years ago
I think I would prefer to move the new function to wp-includes/functions.php where it will always be available.
comment:11
westi — 3 years ago
- Status changed from reopened to closed
- Resolution set to fixed
