wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



get_parent_post_rel_link › WordPress Function

Od2.8.0
Przestarzały3.3.0
get_parent_post_rel_link ( $title = '%title' )
Parametry:
  • (string) $title Optional. Link title format. Default '%title'.
    Wymagane: Nie
    Domyślny: '%title'
Powrót:
  • (string)
Zdefiniowane na:
Codex:

Get parent post relational link.



Źródło

function get_parent_post_rel_link( $title = '%title' ) {
	_deprecated_function( __FUNCTION__, '3.3.0' );

	if ( ! empty( $GLOBALS['post'] ) && ! empty( $GLOBALS['post']->post_parent ) )
		$post = get_post($GLOBALS['post']->post_parent);

	if ( empty($post) )
		return;

	$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 = "<link rel='up' title='";
	$link .= esc_attr( $title );
	$link .= "' href='" . get_permalink($post) . "' />\n";

	return apply_filters( "parent_post_rel_link", $link );
}