get_the_generator [ WordPress Function ]
get_the_generator ( $type = '' )
| Parameters: |
|
| Uses: | |
| Returns: |
|
| Defined at: |
|
Benzer Fonksiyonlar: the_generator, get_the_author, get_the_excerpt, get_the_category, get_the_author_id
Creates the generator XML or Comment for RSS, ATOM, etc.
Returns the correct generator type for the requested output format. Allows for a plugin to filter generators on an individual basis using the 'get_the_generator_{$type}' filter.
Source
<?php
function get_the_generator( $type = '' ) {
if ( empty( $type ) ) {
$current_filter = current_filter();
if ( empty( $current_filter ) )
return;
switch ( $current_filter ) {
case 'rss2_head' :
case 'commentsrss2_head' :
$type = 'rss2';
break;
case 'rss_head' :
case 'opml_head' :
$type = 'comment';
break;
case 'rdf_header' :
$type = 'rdf';
break;
case 'atom_head' :
case 'comments_atom_head' :
case 'app_head' :
$type = 'atom';
break;
}
}
switch ( $type ) {
case 'html':
$gen = '<meta name="generator" content="WordPress ' . get_bloginfo( 'version' ) . '">';
break;
case 'xhtml':
$gen = '<meta name="generator" content="WordPress ' . get_bloginfo( 'version' ) . '" />';
break;
case 'atom':
$gen = '<generator uri="http://wordpress.org/" version="' . get_bloginfo_rss( 'version' ) . '">WordPress</generator>';
break;
case 'rss2':
$gen = '<generator>http://wordpress.org/?v=' . get_bloginfo_rss( 'version' ) . '</generator>';
break;
case 'rdf':
$gen = '<admin:generatorAgent rdf:resource="http://wordpress.org/?v=' . get_bloginfo_rss( 'version' ) . '" />';
break;
case 'comment':
$gen = '<!-- generator="WordPress/' . get_bloginfo( 'version' ) . '" -->';
break;
case 'export':
$gen = '<!-- generator="WordPress/' . get_bloginfo_rss('version') . '" created="'. date('Y-m-d H:i') . '" -->';
break;
}
return apply_filters( "get_the_generator_{$type}", $gen, $type );
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- get_the_generator | A HitchHackers guide through WordPress
Feb 12, 2011 ... function get_the_generator( $type = '' ) { if ( empty( $type ) ) { $current_filter = current_filter(); if ( empty( $current_filter ) ) return; switch ...
hitchhackerguide.com - How to Stop Your WordPress Blog Getting Hacked
Apr 19, 2009 ... function the_generator( $type ) { echo apply_filters('the_generator', get_the_generator($type), $type) . "\n"; }. and place a hash (#) in front of the ...
semlabs.co.uk - get_the_generator (WordPress Function) - WPSeek.com
WordPress lookup for get_the_generator, a WordPress Function. wpseek.com is a WordPress-centric search tool for developers and theme authors.
wpseek.com - The Generator - Zelda: Skyward Sword Wiki Guide - IGN
Nov 20, 2011 ... A robot next to it will give you the low down: there are three Power Nodes that must be activated nearby to get the generator going. You can ...
www.ign.com