Warning: This function has been deprecated.

get_boundary_post_rel_link() WordPress Function

The get_boundary_post_rel_link() function is a utility function that retrieves the boundary post relationship links for the current post. These links are used by the WordPress pagination functions to create previous and next links on single post pages.

get_boundary_post_rel_link( string $title = '%title', bool $in_same_cat = false, string $excluded_categories = '', bool $start = true ) #

Get boundary post relational link.


Description

Can either be start or end post relational link.


Top ↑

Parameters

$title

(string)(Optional) Link title format.

Default value: '%title'

$in_same_cat

(bool)(Optional) Whether link should be in a same category.

Default value: false

$excluded_categories

(string)(Optional) Excluded categories IDs.

Default value: ''

$start

(bool)(Optional) Whether to display link to first or last post.

Default value: true


Top ↑

Return

(string)


Top ↑

Source

File: wp-includes/deprecated.php

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 );
}


Top ↑

Changelog

Changelog
VersionDescription
3.3.0This function has been deprecated.
2.8.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More