#12695 closed task (blessed) (fixed)
Inline docs for Twenty Ten
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 3.0 |
| Component: | Inline Docs | Version: | |
| Severity: | normal | Keywords: | has-patch |
| Cc: | dkikizas@…, aaron@…, dre@… |
Description
1) Document its functions.
2) Consider some PHP comments in various template files to explain certain things, as needed.
Attachments (13)
Change History (40)
comment:3
jorbin
— 3 years ago
- Cc aaron@… added
- Keywords has-patch added; needs-patch removed
Added a first pass at documenting everything. The one I'm not very confident on is the long description of page.php . If someone else has a better idea for that I'm all ears.
comment:4
demetris
— 3 years ago
Attached file with tweaks to jorbin’s first pass (twentytendoc.3.diff).
Main changes:
- Demoted 2010 to @subpackage and added @package WordPress. This is not because 2010 is bundled in the core distribution, but to allow references to core stuff via @uses, @see, etc.
- Added @since in the form X.Y.Z (to conform with core practice, where three levels are used).
- Added file-level phpDoc to index.php.
comment:5
jorbin
— 3 years ago
Added more inline documentation to twentyten_init with the goal of making understanding the easy of creating a child theme. Based on Demetris's tweaks to my first pass.
comment:7
nacin
— 3 years ago
(In [13886]) Second pass on twentyten/functions.php inline documentation. see #12695. Also:
rename twentyten_init() to twentyten_setup(), to reflect the hook it is run on (init would be too late, it must be after_setup_theme). Remove unnecessary twentyten_get_page_number() and transfer functionality to twentyten_the_page_number(). Remove the function_exists() wrappers from functions that are simply tied to a hook, as a better practice would be to remove the hook instead of plugging the function. For architecture changes, see #12748.
comment:9
jorbin
— 3 years ago
I added a new patch that adjust @subpackage to Twenty_Ten based on the requirements from http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_tags.subpackage.pkg.html
Also adds some more inline documentation and @since for both WordPress and Twenty Ten
comment:10
jacobsantos
— 3 years ago
Hey thanks, I just hope this gets committed.
comment:11
dremeda
— 3 years ago
- Cc dre@… added
comment:12
dremeda
— 3 years ago
sorry for the repeat comments here. last one was for search.php not archive.php
comment:13
nacin
— 3 years ago
comment:14
nacin
— 3 years ago
- Status changed from new to accepted
Going to commit a final big patch for this.
comment:15
nacin
— 3 years ago
comment:16
nacin
— 3 years ago
comment:17
nacin
— 3 years ago
Last commit added explanatory and conversational inline documentation throughout the template files. It also made some other changes:
- Give attachment.php, page.php, onecolumn-page, etc. valid loops. Previously done for single.php: [14476].
- Switch @since to a Twenty Ten-specific version. Done previously for functions.php in [14698].
- Don't use the_post/rewind_posts hack in tag.php, we don't need it for single_tag_title.
- Remove erroneous argument to the_excerpt(). See also #13361, which I'll be taking up.
Closing as fixed. Re-open if I break something. Thanks everyone for your help.
comment:18
nacin
— 3 years ago
comment:19
nacin
— 3 years ago
Okay, looking through the patches in the ticket now to see if anything was missed. Sorry Aaron especially, I didn't see some of these (and independently made the @since and @subpackage calls today).
I see some good comments in some of these I want to add. I will go through these tomorrow.
comment:20
zeo
— 3 years ago
Is there still any room for translators comment (i18n)?
zeo
— 3 years ago
Refresh patch. Corrected various end / closing comment. Extra: adds padding to class nopassword.
comment:21
jorbin
— 3 years ago
Added a patch that makes sure every </div> that is not on the same line as the opening <div> is commented and other general improvements.
comment:22
nacin
— 3 years ago
Reviewing this, will clean it up and check it in.
I personally hate the closing div comments in general, but I understand the need for them. That said, I purposely haven't added them (in fact I've removed them) when the content between them -- both in PHP, and what the PHP might generate in terms of markup -- is small. (If the_content() for example is between them, then I'd leave it in.)
comment:23
jorbin
— 3 years ago
I'm not a huge fan of them, but I think it's important to be consistent and that some themers would find them useful, hence why I cleaned up / added the last of the remaining ones.
comment:24
nacin
— 3 years ago
- Resolution set to fixed
- Status changed from accepted to closed
comment:25
zeo
— 3 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
comment:26
nacin
— 3 years ago
- Resolution set to fixed
- Status changed from reopened to closed
comment:27
nacin
— 3 years ago
Thanks zeo, I missed those when massaging previous patches.
(In [13816]) Switch to get_template_part Fixes #12371. Try on some narrative comments for size see #12695.