wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
get_feed_link › WordPress Function
Seit1.5.0
Veraltetn/v
› get_feed_link ( $feed = '' )
Parameter: |
|
Gibt zurück: |
|
Definiert in: |
|
Codex: |
Retrieves the permalink for the feed type.
Ähnliche Funktionen: get_tag_feed_link, the_feed_link, get_term_feed_link, get_day_link, get_search_feed_link
Quellcode
function get_feed_link( $feed = '' ) { global $wp_rewrite; $permalink = $wp_rewrite->get_feed_permastruct(); if ( $permalink ) { if ( str_contains( $feed, 'comments_' ) ) { $feed = str_replace( 'comments_', '', $feed ); $permalink = $wp_rewrite->get_comment_feed_permastruct(); } if ( get_default_feed() === $feed ) { $feed = ''; } $permalink = str_replace( '%feed%', $feed, $permalink ); $permalink = preg_replace( '#/+#', '/', "/$permalink" ); $output = home_url( user_trailingslashit( $permalink, 'feed' ) ); } else { if ( empty( $feed ) ) { $feed = get_default_feed(); } if ( str_contains( $feed, 'comments_' ) ) { $feed = str_replace( 'comments_', 'comments-', $feed ); } $output = home_url( "?feed={$feed}" ); } /** * Filters the feed type permalink. * * @since 1.5.0 * * @param string $output The feed permalink. * @param string $feed The feed type. Possible values include 'rss2', 'atom', * or an empty string for the default feed type. */ return apply_filters( 'feed_link', $output, $feed ); }