Un motore di ricerca WordPress per sviluppatori e autori di temi



add_feed ›

Da2.1.0
Deprecaton/a
add_feed ( $feedname, $function )
Parametri: (2)
  • (string) $feedname Feed name.
    Richiesto:
  • (callable) $function Callback to run on feed display.
    Richiesto:
Ritorna:
  • (string) Feed action name.
Definito a:
Codex:

Add a new feed type like /atom1/.



Sorgenti

function add_feed( $feedname, $function ) {
	global $wp_rewrite;

	if ( ! in_array( $feedname, $wp_rewrite->feeds ) ) {
		$wp_rewrite->feeds[] = $feedname;
	}

	$hook = 'do_feed_' . $feedname;

	// Remove default function hook
	remove_action( $hook, $hook );

	add_action( $hook, $function, 10, 2 );

	return $hook;
}