wpseek.com
WordPress开发者和主题制作者的搜索引擎
get_boundary_post_rel_link is deprecated since version 3.3.0!
get_boundary_post_rel_link › WordPress Function
Since2.8.0
已弃用3.3.0
› get_boundary_post_rel_link ( $title = '%title', $in_same_cat = false, $excluded_categories = '', $start = true )
参数: (4) |
|
返回: |
|
定义在: |
|
文档: |
Get boundary post relational link.
Can either be start or end post relational link.Related Functions: get_parent_post_rel_link, get_boundary_post, get_post_reply_link, start_post_rel_link, get_adjacent_post_rel_link
源码
function get_boundary_post_rel_link($title = '%title', $in_same_cat = false, $excluded_categories = '', $start = true) { _deprecated_function( __FUNCTION__, '3.3.0' ); $posts = get_boundary_post($in_same_cat, $excluded_categories, $start); // If there is no post, stop. if ( empty($posts) ) return; // Even though we limited get_posts() to return only 1 item it still returns an array of objects. $post = $posts[0]; if ( empty($post->post_title) ) $post->post_title = $start ? __('First Post') : __('Last Post'); $date = mysql2date(get_option('date_format'), $post->post_date); $title = str_replace('%title', $post->post_title, $title); $title = str_replace('%date', $date, $title); $title = apply_filters('the_title', $title, $post->ID); $link = $start ? "<link rel='start' title='" : "<link rel='end' title='"; $link .= esc_attr($title); $link .= "' href='" . get_permalink($post) . "' />\n"; $boundary = $start ? 'start' : 'end'; return apply_filters( "{$boundary}_post_rel_link", $link ); }