Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




get_parent_post_rel_link [ WordPress Function ]

get_parent_post_rel_link ( $title = '%title' )
Parameters:
  • (string) $title Optional. Link title format.
Returns:
  • (string)
Defined at:



Get parent post relational link.

Source


<?php
function get_parent_post_rel_link($title '%title') {
    
_deprecated_function__FUNCTION__'3.3' );

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

Examples [ wp-snippets.com ]

Top Google Search Results

More ...

User discussions [ wordpress.org ]

0 User Note(s)

None yet. Be the first!

Add New ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics