Opened 17 years ago
Closed 17 years ago
#5085 closed enhancement (fixed)
Unify generator strings
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 2.5 | Priority: | normal |
Severity: | normal | Version: | 2.3 |
Component: | General | Keywords: | privacy generator has-patch |
Focuses: | Cc: |
Description
In WordPress 2.3, there are about a dozen plus places that use a
generator comment or a generator XML element.
I would like to suggest adding an API for building the generator
interfaces. However, to me, the only obvious (and consistent)
generator string is the XML comment.
wp_generator_comment() would generate an XML comment such as:
<!-- generator="wordpress/2.3" -->
I need help figuring out an API for the various XML node formats, such
as:
<generator uri="http://wordpress.com/" version="1.0.5-dc">WordPress.com Atom API</generator> <generator>http://wordpress.org/?v=<?php bloginfo_rss('version'); ?></generator> <generator>http://wordpress.org/?v=<?php echo $wp_version ?></generator> <generator uri="http://wordpress.org/" version="<?php bloginfo_rss('version'); ?>">WordPress</generator> <generator uri="http://wordpress.org/" version="<?php bloginfo('version'); ?>">WordPress</generator> <admin:generatorAgent rdf:resource="http://wordpress.org/?v=<?php echo $wp_version ?>"/>
Tracing through the code I couldn't easily tell what bloginfo_rss
returns, I assume it returns $wp_version;
This would prevent repetition of code and allow for admins or plugin developers to add or remove information they are not comfortable sending out.
Ciao!
PS: This is related to bug #5065 in spirit.
Attachments (3)
Change History (19)
#3
follow-up:
↓ 4
@
17 years ago
- Milestone changed from 2.5 to 2.4
- Owner changed from anonymous to docwhat
I like it. It's somewhat related to #4803, also.
#4
in reply to:
↑ 3
;
follow-up:
↓ 7
@
17 years ago
Replying to JeremyVisser:
milestone changed from 2.5 to 2.4.
Generally, I've been leaving things without core developer owner or patch to trunk+1 .
#5
@
17 years ago
- Keywords privacy generator added
JeremyVisser: Thanks for the info. Some of the concerns there applied to my patch, too.
Everyone:
I have attached a patch. The only problems I can think of is where it's located in the file or it's name. I can make those changes quickly, feel free to give me feedback.
Ciao!
#7
in reply to:
↑ 4
@
17 years ago
Replying to foolswisdom:
Replying to JeremyVisser:
milestone changed from 2.5 to 2.4.
Generally, I've been leaving things without core developer owner or patch to trunk+1 .
Thanks for that Lloyd. I'll try and remember that for next time. :)
Part of the reason I changed it to 2.4 was that #4803's milestone was 2.4.
#8
follow-up:
↓ 9
@
17 years ago
In line with #4803, the generator tags could then be stripped out of the templates, and adding something like this somewhere:
add_action( 'wp_head', create_function('', "wp_get_generator('xhtml');") );
#9
in reply to:
↑ 8
@
17 years ago
Replying to JeremyVisser:
In line with #4803, the generator tags could then be stripped out of the templates, and adding something like this somewhere:
Even better, you can detect the DTD and user 'xhtml' or 'html' as appropriate!
Ciao!
#10
@
17 years ago
- Owner changed from docwhat to westi
- Status changed from new to assigned
I will take a look at these patches and review them.
#11
@
17 years ago
Ok I've reworked the patch to include the changes from #4803 and to improve the functionality a little bit.
New patch about to be attached.
Here is a summary of the changes:
wp-app.php | 2 - wp-content/themes/classic/header.php | 2 - wp-content/themes/default/header.php | 2 - wp-includes/default-filters.php | 3 +- wp-includes/feed-atom-comments.php | 2 - wp-includes/feed-atom.php | 2 - wp-includes/feed-rdf.php | 4 +-- wp-includes/feed-rss.php | 2 - wp-includes/feed-rss2-comments.php | 4 +-- wp-includes/feed-rss2.php | 4 +-- wp-includes/general-template.php | 43 +++++++++++++++++++++++++++++++++++ wp-links-opml.php | 2 - 12 files changed, 56 insertions(+), 16 deletions(-)
#12
@
17 years ago
Suggestion: In feed-rss2.php, feed-rss2-comments.php, and feed-rdf.php, remove the call to <?php the_generator( 'comment' ); ?>. It's unnecessary, the rss2 format contains the stuff for a generator explicitly, we don't need an extra comment type thing in there. It's just taking up space to give the same information that's available in there already.
Other than that, +1.
#13
@
17 years ago
Note to self: We also need to include the generator for the export file in these changes
Most of the feeds and such have their own syntax for expressing the generator. So there's no one universal way.
I'd suggest something like this:
Then call the appropriate one with <?php echo get_generator('whatever'); ?> at the right point in the code.