Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




add_feed [ WordPress Function ]

add_feed ( $feedname, $function )
Parameters:
  • (string) $feedname
  • (callback) $function Callback to run on feed display.
Returns:
  • (string) Feed action name.
Defined at:



Add a new feed type like /atom1/.

Source


<?php
function add_feed($feedname$function) {
    global 
$wp_rewrite;
    if ( ! 
in_array($feedname$wp_rewrite->feeds) ) //override the file if it is
        
$wp_rewrite->feeds[] = $feedname;
    
$hook 'do_feed_' $feedname;
    
// Remove default function hook
    
remove_action($hook$hook101);
    
add_action($hook$function101);
    return 
$hook;
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics